123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307 |
- <?php
- namespace App\Entity;
- use App\Repository\EventRepository;
- use Doctrine\Common\Collections\ArrayCollection;
- use Doctrine\Common\Collections\Collection;
- use Doctrine\DBAL\Types\Types;
- use Doctrine\ORM\Mapping as ORM;
- use Symfony\Bridge\Doctrine\Types\UuidType;
- use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
- use Symfony\Component\Uid\Uuid;
- #[ORM\Entity(repositoryClass: EventRepository::class)]
- class Event
- {
- #[ORM\Id]
- #[ORM\Column(type: UuidType::NAME, unique: true)]
- #[ORM\GeneratedValue(strategy: 'CUSTOM')]
- #[ORM\CustomIdGenerator(class: 'doctrine.uuid_generator')]
- private ?Uuid $id = null;
- #[ORM\Column(length: 255)]
- private ?string $name = null;
- #[ORM\Column(type: Types::TEXT, nullable: true)]
- private ?string $description = null;
- #[ORM\Column(length: 255, nullable: true)]
- private ?string $picture = null;
- #[ORM\Column(type: Types::DATETIME_MUTABLE)]
- private ?\DateTimeInterface $startOn = null;
- #[ORM\Column(type: Types::DATETIME_MUTABLE)]
- private ?\DateTimeInterface $endOn = null;
- #[ORM\Column(type: Types::ASCII_STRING, nullable: true)]
- private $moreLink;
- #[ORM\Column(type: Types::ASCII_STRING, nullable: true)]
- private $slug;
- #[ORM\Column(nullable: true)]
- private ?bool $published = null;
- #[ORM\Column(nullable: true)]
- private ?bool $private = null;
- #[ORM\Column(nullable: true)]
- private ?bool $hiddenPlanning = null;
- #[ORM\Column(nullable: true)]
- private ?bool $everyoneCanAskForGame = null;
- /**
- * @var Collection<int, Space>
- */
- #[ORM\OneToMany(targetEntity: Space::class, mappedBy: 'event', orphanRemoval: true)]
- private Collection $spaces;
- /**
- * @var Collection<int, Period>
- */
- #[ORM\OneToMany(targetEntity: Period::class, mappedBy: 'event', orphanRemoval: true)]
- private Collection $periods;
- /**
- * @var Collection<int, Slot>
- */
- #[ORM\OneToMany(targetEntity: Slot::class, mappedBy: 'event', orphanRemoval: true)]
- private Collection $slots;
- public function __construct()
- {
- $this->spaces = new ArrayCollection();
- $this->periods = new ArrayCollection();
- $this->slots = new ArrayCollection();
- }
- public function getId(): ?Uuid
- {
- return $this->id;
- }
- public function getName(): ?string
- {
- return $this->name;
- }
- public function setName(string $name): static
- {
- $this->name = $name;
- return $this;
- }
- public function getDescription(): ?string
- {
- return $this->description;
- }
- public function setDescription(?string $description): static
- {
- $this->description = $description;
- return $this;
- }
- public function getPicture(): ?string
- {
- return $this->picture;
- }
- public function setPicture(?string $picture): static
- {
- $this->picture = $picture;
- return $this;
- }
- public function getStartOn(): ?\DateTimeInterface
- {
- return $this->startOn;
- }
- public function setStartOn(\DateTimeInterface $startOn): static
- {
- $this->startOn = $startOn;
- return $this;
- }
- public function getEndOn(): ?\DateTimeInterface
- {
- return $this->endOn;
- }
- public function setEndOn(\DateTimeInterface $endOn): static
- {
- $this->endOn = $endOn;
- return $this;
- }
- public function getMoreLink()
- {
- return $this->moreLink;
- }
- public function setMoreLink($moreLink): static
- {
- $this->moreLink = $moreLink;
- return $this;
- }
- public function getSlug()
- {
- return $this->slug;
- }
- public function setSlug($slug): static
- {
- $this->slug = $slug;
- return $this;
- }
- public function isPublished(): ?bool
- {
- return $this->published;
- }
- public function setPublished(?bool $published): static
- {
- $this->published = $published;
- return $this;
- }
- public function isPrivate(): ?bool
- {
- return $this->private;
- }
- public function setPrivate(?bool $private): static
- {
- $this->private = $private;
- return $this;
- }
- public function isHiddenPlanning(): ?bool
- {
- return $this->hiddenPlanning;
- }
- public function setHiddenPlanning(?bool $hiddenPlanning): static
- {
- $this->hiddenPlanning = $hiddenPlanning;
- return $this;
- }
- public function isEveryoneCanAskForGame(): ?bool
- {
- return $this->everyoneCanAskForGame;
- }
- public function setEveryoneCanAskForGame(?bool $everyoneCanAskForGame): static
- {
- $this->everyoneCanAskForGame = $everyoneCanAskForGame;
- return $this;
- }
- /**
- * @return Collection<int, Space>
- */
- public function getSpaces(): Collection
- {
- return $this->spaces;
- }
- public function addSpace(Space $space): static
- {
- if (!$this->spaces->contains($space)) {
- $this->spaces->add($space);
- $space->setEvent($this);
- }
- return $this;
- }
- public function removeSpace(Space $space): static
- {
- if ($this->spaces->removeElement($space)) {
- // set the owning side to null (unless already changed)
- if ($space->getEvent() === $this) {
- $space->setEvent(null);
- }
- }
- return $this;
- }
- /**
- * @return Collection<int, Period>
- */
- public function getPeriods(): Collection
- {
- return $this->periods;
- }
- public function addPeriod(Period $period): static
- {
- if (!$this->periods->contains($period)) {
- $this->periods->add($period);
- $period->setEvent($this);
- }
- return $this;
- }
- public function removePeriod(Period $period): static
- {
- if ($this->periods->removeElement($period)) {
- // set the owning side to null (unless already changed)
- if ($period->getEvent() === $this) {
- $period->setEvent(null);
- }
- }
- return $this;
- }
- /**
- * @return Collection<int, Slot>
- */
- public function getSlots(): Collection
- {
- return $this->slots;
- }
- public function addSlot(Slot $slot): static
- {
- if (!$this->slots->contains($slot)) {
- $this->slots->add($slot);
- $slot->setEvent($this);
- }
- return $this;
- }
- public function removeSlot(Slot $slot): static
- {
- if ($this->slots->removeElement($slot)) {
- // set the owning side to null (unless already changed)
- if ($slot->getEvent() === $this) {
- $slot->setEvent(null);
- }
- }
- return $this;
- }
- }
|