Ejemplo n.º 1
0
 /**
  * @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);
 }
Ejemplo n.º 2
0
 /**
  * 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());
 }
Ejemplo n.º 4
0
 public function __construct(array $hierarchy, EntityManagerInterface $em)
 {
     $this->em = $em;
     parent::__construct($this->buildRolesTree($hierarchy));
 }
Ejemplo n.º 5
0
 /**
  *
  * @param RoleManagerInterface $rm
  */
 public function __construct(RoleManagerInterface $rm)
 {
     $this->rm = $rm;
     $map = $this->buildRolesTree();
     parent::__construct($map);
 }
Ejemplo n.º 6
0
 /**
  * 
  * @param array $hierarchy
  * @param ObjectManager $objectManager
  */
 public function __construct(array $staticHierarchy, ObjectManager $objectManager)
 {
     $this->objectManager = $objectManager;
     parent::__construct($this->buildGroupTree($staticHierarchy));
 }