src/Entity/OpenDay.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\OpenDayRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. #[ORM\Entity(repositoryClassOpenDayRepository::class)]
  8. #[ORM\HasLifecycleCallbacks]
  9. class OpenDay
  10. {
  11.     use \App\Traits\EntityDateTimeAbleTrait;
  12.     #[ORM\Id]
  13.     #[ORM\GeneratedValue]
  14.     #[ORM\Column(type'integer')]
  15.     private $id;
  16.     #[ORM\Column(type'string'length255nullabletrue)]
  17.     private ?string $name null;
  18.     #[ORM\Column(type'string'length255nullabletrue)]
  19.     private ?string $hour null;
  20.     #[ORM\Column(type'string'length255nullabletrue)]
  21.     private ?string $minute null;
  22.     #[ORM\Column(type'string'length255nullabletrue)]
  23.     private ?string $address null;
  24.     #[ORM\Column(type'text'nullabletrue)]
  25.     private ?string $content null;
  26.     #[ORM\OneToMany(targetEntityOpenDayPerson::class, mappedBy'openDay')]
  27.     private Collection $openDayPeople;
  28.     #[ORM\Column(type'date'nullabletrue)]
  29.     private ?\DateTimeInterface $date null;
  30.     #[ORM\Column(type'string'length255nullabletrue)]
  31.     private ?string $time null;
  32.     #[ORM\Column(type'integer'nullabletrue)]
  33.     private ?int $status null;
  34.     #[ORM\ManyToMany(targetEntityCampus::class, inversedBy'openDay'cascade: ['persist'])]
  35.     private Collection $campuses;
  36.     #[ORM\Column(type'string'length255nullabletrue)]
  37.     private ?string $slug null;
  38.     #[ORM\OneToOne(targetEntityMedia::class, cascade: ['persist''remove'])]
  39.     private ?\App\Entity\Media $photo null;
  40.     #[ORM\ManyToOne(targetEntityCampaign::class, inversedBy'openDays')]
  41.     private ?\App\Entity\Campaign $campaign null;
  42.     public function __construct()
  43.     {
  44.         $this->openDayPeople = new ArrayCollection();
  45.         $this->campuses = new ArrayCollection();
  46.     }
  47.     public function getId(): ?int
  48.     {
  49.         return $this->id;
  50.     }
  51.     public function getName(): ?string
  52.     {
  53.         return $this->name;
  54.     }
  55.     public function setName(?string $name): self
  56.     {
  57.         $this->name $name;
  58.         return $this;
  59.     }
  60.     public function getHour(): ?string
  61.     {
  62.         return $this->hour;
  63.     }
  64.     public function setHour(?string $hour): self
  65.     {
  66.         $this->hour $hour;
  67.         return $this;
  68.     }
  69.     public function getMinute(): ?string
  70.     {
  71.         return $this->minute;
  72.     }
  73.     public function setMinute(?string $minute): self
  74.     {
  75.         $this->minute $minute;
  76.         return $this;
  77.     }
  78.     public function getAddress(): ?string
  79.     {
  80.         return $this->address;
  81.     }
  82.     public function setAddress(?string $address): self
  83.     {
  84.         $this->address $address;
  85.         return $this;
  86.     }
  87.     public function getContent(): ?string
  88.     {
  89.         return $this->content;
  90.     }
  91.     public function setContent(?string $content): self
  92.     {
  93.         $this->content $content;
  94.         return $this;
  95.     }
  96.     /**
  97.      * @return Collection<int, OpenDayPerson>
  98.      */
  99.     public function getOpenDayPeople(): Collection
  100.     {
  101.         return $this->openDayPeople;
  102.     }
  103.     public function addOpenDayPerson(OpenDayPerson $openDayPerson): self
  104.     {
  105.         if (!$this->openDayPeople->contains($openDayPerson)) {
  106.             $this->openDayPeople[] = $openDayPerson;
  107.             $openDayPerson->setOpenDay($this);
  108.         }
  109.         return $this;
  110.     }
  111.     public function removeOpenDayPerson(OpenDayPerson $openDayPerson): self
  112.     {
  113.         if ($this->openDayPeople->removeElement($openDayPerson)) {
  114.             // set the owning side to null (unless already changed)
  115.             if ($openDayPerson->getOpenDay() === $this) {
  116.                 $openDayPerson->setOpenDay(null);
  117.             }
  118.         }
  119.         return $this;
  120.     }
  121.     public function getDate(): ?\DateTimeInterface
  122.     {
  123.         return $this->date;
  124.     }
  125.     public function setDate(?\DateTimeInterface $date): self
  126.     {
  127.         $this->date $date;
  128.         return $this;
  129.     }
  130.     public function getTime(): ?string
  131.     {
  132.         return $this->time;
  133.     }
  134.     public function setTime(?string $time): self
  135.     {
  136.         $this->time $time;
  137.         return $this;
  138.     }
  139.     public function getStatus(): ?int
  140.     {
  141.         return $this->status;
  142.     }
  143.     public function setStatus(?int $status): self
  144.     {
  145.         $this->status $status;
  146.         return $this;
  147.     }
  148.     /**
  149.      * @return Collection<int, Campus>
  150.      */
  151.     public function getCampuses(): Collection
  152.     {
  153.         return $this->campuses;
  154.     }
  155.     public function addCampus(Campus $campus): self
  156.     {
  157.         if (!$this->campuses->contains($campus)) {
  158.             $this->campuses[] = $campus;
  159.         }
  160.         return $this;
  161.     }
  162.     public function removeCampus(Campus $campus): self
  163.     {
  164.         $this->campuses->removeElement($campus);
  165.         return $this;
  166.     }
  167.     public function getSlug(): ?string
  168.     {
  169.         return $this->slug;
  170.     }
  171.     public function setSlug(?string $slug): self
  172.     {
  173.         $this->slug $slug;
  174.         return $this;
  175.     }
  176.     public function getPhoto(): ?Media
  177.     {
  178.         return $this->photo;
  179.     }
  180.     public function setPhoto(?Media $photo): self
  181.     {
  182.         $this->photo $photo;
  183.         return $this;
  184.     }
  185.     public function getCampaign(): ?Campaign
  186.     {
  187.         return $this->campaign;
  188.     }
  189.     public function setCampaign(?Campaign $campaign): self
  190.     {
  191.         $this->campaign $campaign;
  192.         return $this;
  193.     }
  194. }