roles = new ArrayCollection(); $this->enabled = true; } // array of string roles, needed by symfony public function getRoles() { $str_roles = []; foreach ($this->roles as $role) $str_roles[] = $role->getID(); return $str_roles; } public function getRoleObjects() { return $this->roles; } public function addRole(Role $role) { $this->roles->add($role); return $this; } public function clearRoles() { $this->roles->clear(); return $this; } public function setEnabled($enabled = true) { $this->enabled = $enabled; return $this; } public function isEnabled() { return $this->enabled; } }