initAllRights(); } private function initAllRights(): void { $this->rights = new ArrayCollection(); foreach (RightType::getChoices() as $key=>$value){ $right = new Right(); $right->setType($value); $right->setLaw($this); $this->rights->set($key, $right); } } }