<?phpnamespace App\Entity;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;/** * Document * * @ORM\Table(name="event_opsprod") * @ORM\Entity */class EventOpsProd{ use \Gedmo\Timestampable\Traits\TimestampableEntity; use BlameableEntity; /** * @var int * * @ORM\Column(name="id", type="integer") * @ORM\Id * @ORM\GeneratedValue(strategy="AUTO") */ private $id; /** * EDITABLE IN ENET * @ORM\OneToMany(targetEntity="App\Entity\EventUserRights", mappedBy="eventOpsProd", cascade={"all"}, orphanRemoval=true) */ private $userRights; /** * EDITABLE IN ENET * @ORM\OneToMany(targetEntity="App\Entity\EventCompanyRights", mappedBy="eventOpsProd", cascade={"all"}, orphanRemoval=true) */ private $companyRights; /** * @var Event $event * @ORM\OneToOne(targetEntity="App\Entity\Event", mappedBy="eventOpsProd") * @ORM\JoinColumn(name="event_id", referencedColumnName="id") */ private $event; public function __construct() { $this->userRights = new ArrayCollection(); $this->companyRights = new ArrayCollection(); } public function __toString(): string { return 'Opsprod for ' . $this->event->getEventNo(); } /** * @return Event */ public function getEvent(): Event { return $this->event; } /** * @param Event $event */ public function setEvent(Event $event): void { $this->event = $event; } public function addUserRightsUid(string $uid) { $eventUserRights = new EventUserRights(); $eventUserRights->setEventOpsProd($this); $eventUserRights->setUid($uid); $this->userRights->add($eventUserRights); } /** * WARN used by introspection by sonata admin * * @param EventUserRights $eventUserRights */ public function addUserRight(EventUserRights $eventUserRights) { $eventUserRights->setEventOpsProd($this); $this->userRights->add($eventUserRights); } /** * Remove userRight * * @param EventUserRights $userRight */ public function removeUserRight(EventUserRights $userRight) { $this->userRights->removeElement($userRight); } public function addCompanyRightsUid(string $uid) { $eventCompanyRights = new EventCompanyRights(); $eventCompanyRights->setEventOpsProd($this); $eventCompanyRights->setUid($uid); $this->companyRights->add($eventCompanyRights); } /** * WARN used by introspection by sonata admin * * @param EventCompanyRights $eventCompanyRights */ public function addCompanyRight(EventCompanyRights $eventCompanyRights) { $eventCompanyRights->setEventOpsProd($this); $this->companyRights->add($eventCompanyRights); } /** * @param EventCompanyRights $companyRights */ public function removeCompanyRight(EventCompanyRights $companyRights) { $this->companyRights->removeElement($companyRights); } /** * @return mixed */ public function getUserRights(): Collection { return $this->userRights; } /** * @param mixed $userRights */ public function setUserRights(Collection $userRights): void { $this->userRights = $userRights; } /** * @return mixed */ public function getCompanyRights(): Collection { return $this->companyRights; } /** * @param mixed $companyRights */ public function setCompanyRights(Collection $companyRights): void { $this->companyRights = $companyRights; } /** * Get id * * @return integer */ public function getId() { return $this->id; } public function toString(): string { return "{id=" . $this->id . "}"; }}