setGuestUserSource(); $this->setImpressumSource(); $manager->persist($this->impressumSource); $manager->persist($this->getImpressumRight()); $manager->persist($this->guestUserSource); $manager->flush(); } private function setImpressumSource(): void { $this->impressumSource = new TextSource(); $this->impressumSource->setText('Example Impressum'); $this->impressumSource->setSlug(SystemSlugType::IMPRINT); } /** * @todo Implement that right gets automaticly created by persisting of law * * @return RightInterface */ private function getImpressumRight(): RightInterface { $right = new Right(); $sourceRightManager = new SourceRightManager($this->impressumSource); $sourceRightManager->addRight($right); $right->setLayer(LayerType::SOURCE); $right->setCrud(CRUDType::READ); $right->setReciever($this->guestUserSource); return $right; } private function setGuestUserSource(): void { $this->guestUserSource = new UserSource(); $this->guestUserSource->setSlug(SystemSlugType::GUEST_USER); } }