/** * @param array $hierarchy */ public function __construct(EntityManager $em, $session = '', $sessionKey = '') { $this->em = $em; $this->session = $session; $this->sessionKey = $sessionKey; $hierarchy = $this->buildRolesTree(); parent::__construct($hierarchy); }
/** * Constructor. * * @param array $hierarchy An array defining the hierarchy */ public function __construct(array $hierarchy) { // Reverse the role hierarchy. $reversed = []; foreach ($hierarchy as $main => $roles) { foreach ($roles as $role) { $reversed[$role][] = $main; } } // Use the original algorithm to build the role map. parent::__construct($reversed); }
/** * * @param array $hierarchy */ public function __construct(Doctrine $doctrine) { $this->em = $doctrine->getManager(); parent::__construct($this->buildRolesTree()); }
public function __construct(array $hierarchy, EntityManagerInterface $em) { $this->em = $em; parent::__construct($this->buildRolesTree($hierarchy)); }
/** * * @param RoleManagerInterface $rm */ public function __construct(RoleManagerInterface $rm) { $this->rm = $rm; $map = $this->buildRolesTree(); parent::__construct($map); }
/** * * @param array $hierarchy * @param ObjectManager $objectManager */ public function __construct(array $staticHierarchy, ObjectManager $objectManager) { $this->objectManager = $objectManager; parent::__construct($this->buildGroupTree($staticHierarchy)); }