Acl\Controller\Component\AclComponent::adapter PHP Method

adapter() public method

$this->Acl->adapter(); will get the current adapter class while $this->Acl->adapter($obj); will set the adapter class Will call the initialize method on the adapter if setting a new one.
public adapter ( Acl\AclInterface | string $adapter = null ) : Acl\AclInterface | void
$adapter Acl\AclInterface | string Instance of AclInterface or a string name of the class to use. (optional)
return Acl\AclInterface | void either null, or the adapter implementation.
    public function adapter($adapter = null)
    {
        if ($adapter) {
            if (is_string($adapter)) {
                $adapter = new $adapter();
            }
            if (!$adapter instanceof AclInterface) {
                throw new Exception('AclComponent adapters must implement AclInterface');
            }
            $this->_Instance = $adapter;
            $this->_Instance->initialize($this);
            return;
        }
        return $this->_Instance;
    }