示例#1
0
 public function __construct()
 {
     parent::__construct();
     $this->salt = base_convert(sha1(uniqid(mt_rand(), true)), 16, 36);
     $this->roles = new ArrayCollection();
     $this->groups = new ArrayCollection();
     $this->statuses = new ArrayCollection();
     $this->emails = new ArrayCollection();
     $this->businessUnits = new ArrayCollection();
     $this->emailOrigins = new ArrayCollection();
     $this->organizations = new ArrayCollection();
     $this->apiKeys = new ArrayCollection();
 }
示例#2
0
文件: User.php 项目: eltrino/platform
 /**
  * {@inheritdoc}
  */
 public function getRoles()
 {
     $roles = parent::getRoles();
     /** @var Group $group */
     foreach ($this->getGroups() as $group) {
         $roles = array_merge($roles, $group->getRoles()->toArray());
     }
     return array_unique($roles);
 }