src/Entity/Event.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Entity\Traits\EntityTrait;
  4. use App\Repository\EventRepository;
  5. use Doctrine\Common\Collections\ArrayCollection;
  6. use Doctrine\Common\Collections\Collection;
  7. use Doctrine\ORM\Mapping as ORM;
  8. /**
  9.  * @ORM\Entity(repositoryClass=EventRepository::class)
  10.  */
  11. class Event
  12. {
  13.     use EntityTrait{
  14.         EntityTrait::__construct as private __entityConstruct;
  15.     }
  16.     /**
  17.      * @ORM\Column(type="string", length=255)
  18.      */
  19.     private $name;
  20.     /**
  21.      * @ORM\Column(type="boolean")
  22.      */
  23.     private $allday;
  24.     /**
  25.      * @ORM\Column(type="datetime")
  26.      */
  27.     private $start_date;
  28.     /**
  29.      * @ORM\Column(type="datetime")
  30.      */
  31.     private $end_date;
  32.     /**
  33.      * @ORM\Column(type="text", nullable=true)
  34.      */
  35.     private $description;
  36.     /**
  37.      * @ORM\ManyToOne(targetEntity=User::class)
  38.      */
  39.     private $created_by;
  40.     /**
  41.      * @ORM\ManyToMany(targetEntity=User::class, inversedBy="events")
  42.      */
  43.     private $users;
  44.     /**
  45.      * @ORM\ManyToOne(targetEntity=CustomerContact::class, inversedBy="events")
  46.      */
  47.     private $customerContact;
  48.      /**
  49.      * @ORM\Column(type="string", length=255)
  50.      */
  51.     private $address;
  52.     /**
  53.      * @ORM\Column(type="string", length=255)
  54.      */
  55.     private $postal_code;
  56.     /**
  57.      * @ORM\Column(type="string", length=255)
  58.      */
  59.     private $city;
  60.     public function __construct()
  61.     {
  62.         $this->__entityConstruct();
  63.         $this->users = new ArrayCollection();
  64.     }
  65.     public function getName(): ?string
  66.     {
  67.         return $this->name;
  68.     }
  69.     public function setName(string $name): self
  70.     {
  71.         $this->name $name;
  72.         return $this;
  73.     }
  74.     public function getAllday(): ?bool
  75.     {
  76.         return $this->allday;
  77.     }
  78.     public function setAllday(bool $allday): self
  79.     {
  80.         $this->allday $allday;
  81.         return $this;
  82.     }
  83.     public function getStartDate(): ?\DateTimeInterface
  84.     {
  85.         return $this->start_date;
  86.     }
  87.     public function setStartDate(\DateTimeInterface $start_date): self
  88.     {
  89.         $this->start_date $start_date;
  90.         return $this;
  91.     }
  92.     public function getEndDate(): ?\DateTimeInterface
  93.     {
  94.         return $this->end_date;
  95.     }
  96.     public function setEndDate(\DateTimeInterface $end_date): self
  97.     {
  98.         $this->end_date $end_date;
  99.         return $this;
  100.     }
  101.     public function getDescription(): ?string
  102.     {
  103.         return $this->description;
  104.     }
  105.     public function setDescription(?string $description): self
  106.     {
  107.         $this->description $description;
  108.         return $this;
  109.     }
  110.     public function getCreatedBy(): ?User
  111.     {
  112.         return $this->created_by;
  113.     }
  114.     public function setCreatedBy(?User $created_by): self
  115.     {
  116.         $this->created_by $created_by;
  117.         return $this;
  118.     }
  119.     /**
  120.      * @return Collection|User[]
  121.      */
  122.     public function getUsers(): Collection
  123.     {
  124.         return $this->users;
  125.     }
  126.     public function addUser(User $user): self
  127.     {
  128.         if (!$this->users->contains($user)) {
  129.             $this->users[] = $user;
  130.         }
  131.         return $this;
  132.     }
  133.     public function removeUser(User $user): self
  134.     {
  135.         $this->users->removeElement($user);
  136.         return $this;
  137.     }
  138.     public function getCustomerContact(): ?CustomerContact
  139.     {
  140.         return $this->customerContact;
  141.     }
  142.     public function setCustomerContact(?CustomerContact $customerContact): self
  143.     {
  144.         $this->customerContact $customerContact;
  145.         return $this;
  146.     }
  147.     public function getAddress(): ?string
  148.     {
  149.         return $this->address;
  150.     }
  151.     public function setAddress(string $address): self
  152.     {
  153.         $this->address $address;
  154.         return $this;
  155.     }
  156.     public function getPostalCode(): ?string
  157.     {
  158.         return $this->postal_code;
  159.     }
  160.     public function setPostalCode(string $postal_code): self
  161.     {
  162.         $this->postal_code $postal_code;
  163.         return $this;
  164.     }
  165.     public function getCity(): ?string
  166.     {
  167.         return $this->city;
  168.     }
  169.     public function setCity(string $city): self
  170.     {
  171.         $this->city $city;
  172.         return $this;
  173.     }
  174. }