コード例 #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);
 }
コード例 #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);
 }
コード例 #3
0
 /**
  *
  * @param array $hierarchy
  */
 public function __construct(Doctrine $doctrine)
 {
     $this->em = $doctrine->getManager();
     parent::__construct($this->buildRolesTree());
 }
コード例 #4
0
 public function __construct(array $hierarchy, EntityManagerInterface $em)
 {
     $this->em = $em;
     parent::__construct($this->buildRolesTree($hierarchy));
 }
コード例 #5
0
ファイル: RoleHierarchy.php プロジェクト: sasedev/acf-expert
 /**
  *
  * @param RoleManagerInterface $rm
  */
 public function __construct(RoleManagerInterface $rm)
 {
     $this->rm = $rm;
     $map = $this->buildRolesTree();
     parent::__construct($map);
 }
コード例 #6
0
ファイル: GroupHierarchy.php プロジェクト: Ad-Honorem/site
 /**
  * 
  * @param array $hierarchy
  * @param ObjectManager $objectManager
  */
 public function __construct(array $staticHierarchy, ObjectManager $objectManager)
 {
     $this->objectManager = $objectManager;
     parent::__construct($this->buildGroupTree($staticHierarchy));
 }