src/BjyAuthorize/Service/Authorize.php
public function load()
    {
        if (null === $this->loaded) {
            return;
        }

        $this->loaded = null;

        /** @var $cache StorageInterface */
        $cache      = $this->serviceLocator->get('BjyAuthorize\Cache');

        /** @var $cacheKeyGenerator callable */
        $cacheKeyGenerator  = $this->serviceLocator->get('BjyAuthorize\CacheKeyGenerator');
        $cacheKey           = $cacheKeyGenerator();

        $success    = false;
        $this->acl  = $cache->getItem($cacheKey, $success);

        if (!($this->acl instanceof Acl) || !$success) {
            $this->loadAcl();
            $cache->setItem($cacheKey, $this->acl);
        }

        $this->setIdentityProvider($this->serviceLocator->get('BjyAuthorize\Provider\Identity\ProviderInterface'));

        $parentRoles = $this->getIdentityProvider()->getIdentityRoles();

        $this->acl->addRole($this->getIdentity(), $parentRoles);
    }
public function load()
    {
        if (null === $this->loaded) {
            return;
        }

        $this->loaded = null;

        /** @var $cache StorageInterface */
        $cache      = $this->serviceLocator->get('BjyAuthorize\Cache');

        /** @var $cacheKeyGenerator callable */
        $cacheKeyGenerator  = $this->serviceLocator->get('BjyAuthorize\CacheKeyGenerator');
        $cacheKey           = $cacheKeyGenerator();

        $success    = false;
        $this->acl  = $cache->getItem($cacheKey, $success);

        if (!($this->acl instanceof Acl) || !$success) {
            $this->loadAcl();
            $cache->setItem($cacheKey, $this->acl);
        }

        $this->setIdentityProvider($this->serviceLocator->get('BjyAuthorize\Provider\Identity\ProviderInterface'));

        $parentRoles = $this->getIdentityProvider()->getIdentityRoles();

        $this->acl->addRole($this->getIdentity(), $parentRoles);
    }
public function load ( ) { if ( null === $ this -> loaded ) { return ; } $ this -> loaded = null ; /** @var $cache StorageInterface */ $ cache = $ this -> serviceLocator -> get ( 'BjyAuthorize\Cache' ) ; /** @var $cacheKeyGenerator callable */ $ cacheKeyGenerator = $ this -> serviceLocator -> get ( 'BjyAuthorize\CacheKeyGenerator' ) ; $ cacheKey = $ cacheKeyGenerator ( ) ; $ success = false ; $ this -> acl = $ cache -> getItem ( $ cacheKey , $ success ) ; if ( ! ( $ this -> acl instanceof Acl ) || ! $ success ) { $ this -> loadAcl ( ) ; $ cache -> setItem ( $ cacheKey , $ this -> acl ) ; } $ this -> setIdentityProvider ( $ this -> serviceLocator -> get ( 'BjyAuthorize\Provider\Identity\ProviderInterface' ) ) ; $ parentRoles = $ this -> getIdentityProvider ( ) -> getIdentityRoles ( ) ; $ this -> acl -> addRole ( $ this -> getIdentity ( ) , $ parentRoles ) ; }
Initializes the service

@internal

@return void
Initializes the service