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(); }
/** * {@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); }