<?phpnamespace App\Entity\Gos;use App\Repository\Gos\EventFileTypeRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;/** * @ORM\Entity(repositoryClass=EventFileTypeRepository::class) * @ORM\HasLifecycleCallbacks */class EventFileType{ /** * @ORM\Id * @ORM\GeneratedValue * @ORM\Column(type="integer") */ private $id; /** * @ORM\Column(type="string", length=255) */ private $name; /** * @ORM\Column(type="datetime") */ private $createdAt; /** * @ORM\Column(type="datetime", nullable=true) */ private $updatedAt; /** * @ORM\OneToMany(targetEntity=EventFiles::class, mappedBy="eventFileType") */ private $eventFile; public function __construct() { $this->eventFile = new ArrayCollection(); } /** @ORM\PrePersist() */ public function prePersist() { $this->createdAt = new \DateTime(); } /** @ORM\PreUpdate() */ public function preUpdate() { $this->updatedAt = new \DateTime(); } public function __toString() { return (string)$this->name; } public function getId(): ?int { return $this->id; } public function getName(): ?string { return $this->name; } public function setName(string $name): self { $this->name = $name; return $this; } public function getCreatedAt(): ?\DateTimeInterface { return $this->createdAt; } public function setCreatedAt(\DateTimeInterface $createdAt): self { $this->createdAt = $createdAt; return $this; } public function getUpdatedAt(): ?\DateTimeInterface { return $this->updatedAt; } public function setUpdatedAt(?\DateTimeInterface $updatedAt): self { $this->updatedAt = $updatedAt; return $this; } /** * @return Collection|EventFiles[] */ public function getEventFile(): Collection { return $this->eventFile; } public function addEventFile(EventFiles $eventFile): self { if (!$this->eventFile->contains($eventFile)) { $this->eventFile[] = $eventFile; $eventFile->setEventFileType($this); } return $this; } public function removeEventFile(EventFiles $eventFile): self { if ($this->eventFile->contains($eventFile)) { $this->eventFile->removeElement($eventFile); // set the owning side to null (unless already changed) if ($eventFile->getEventFileType() === $this) { $eventFile->setEventFileType(null); } } return $this; }}