Role/RoleHierarchy.php
private function getCachedReachableRoles($id, &$item)
    {
        $roles = null;

        // find the hierarchy in execution cache
        if (isset($this->cacheExec[$id])) {
            return $this->cacheExec[$id];
        }

        // find the hierarchy in cache
        if (null !== $this->cache) {
            $item = $this->cache->getItem($id);
            $reachableRoles = $item->get();

            if ($item->isHit() && null !== $reachableRoles) {
                $roles = $reachableRoles;
            }
        }

        return $roles;
    }
private function getCachedReachableRoles($id, &$item)
    {
        $roles = null;

        // find the hierarchy in execution cache
        if (isset($this->cacheExec[$id])) {
            return $this->cacheExec[$id];
        }

        // find the hierarchy in cache
        if (null !== $this->cache) {
            $item = $this->cache->getItem($id);
            $reachableRoles = $item->get();

            if ($item->isHit() && null !== $reachableRoles) {
                $roles = $reachableRoles;
            }
        }

        return $roles;
    }
private function getCachedReachableRoles ( $ id , & $ item ) { $ roles = null ; // find the hierarchy in execution cache if ( isset ( $ this -> cacheExec [ $ id ] ) ) { return $ this -> cacheExec [ $ id ] ; } // find the hierarchy in cache if ( null !== $ this -> cache ) { $ item = $ this -> cache -> getItem ( $ id ) ; $ reachableRoles = $ item -> get ( ) ; if ( $ item -> isHit ( ) && null !== $ reachableRoles ) { $ roles = $ reachableRoles ; } } return $ roles ; }
Get the reachable roles in cache if available.

@param string $id   The cache id
@param null   $item The cache item variable passed by reference

@throws

@return null|string[]
Get the reachable roles in cache if available .