src/Entity/Events.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\Common\Collections\ArrayCollection;
  4. use Doctrine\Common\Collections\Collection;
  5. use Doctrine\ORM\Mapping as ORM;
  6. /**
  7.  * @ORM\Entity(repositoryClass="App\Repository\EventsRepository")
  8.  */
  9. class Events
  10. {
  11.     /**
  12.      * @ORM\Id()
  13.      * @ORM\GeneratedValue()
  14.      * @ORM\Column(type="integer")
  15.      */
  16.     private $id;
  17.     /**
  18.      * @ORM\Column(type="string", length=255, nullable=true)
  19.      */
  20.     private $title;
  21.     /**
  22.      * @ORM\Column(type="date", nullable=true)
  23.      */
  24.     private $datum;
  25.     /**
  26.      * @ORM\Column(type="time", nullable=true)
  27.      */
  28.     private $time;
  29.     /**
  30.      * @ORM\Column(type="string", length=255, nullable=true)
  31.      */
  32.     private $city;
  33.     /**
  34.      * @ORM\Column(type="text", nullable=true)
  35.      */
  36.     private $description;
  37.     /**
  38.      * @ORM\ManyToOne(targetEntity="App\Entity\EventType", inversedBy="events")
  39.      */
  40.     private $eventType;
  41.     /**
  42.      * @ORM\Column(type="string", length=255, nullable=true)
  43.      */
  44.     private $url;
  45.     /**
  46.      * @ORM\Column(type="string", length=255, nullable=true)
  47.      */
  48.     private $caption;
  49.     /**
  50.      * @ORM\ManyToOne(targetEntity="App\Entity\Cities", inversedBy="events")
  51.      */
  52.     private $cityId;
  53.     /**
  54.      * @ORM\Column(type="string", length=2, nullable=true)
  55.      */
  56.     private $language;
  57.     /**
  58.      * @ORM\Column(type="date", nullable=true)
  59.      */
  60.     private $endDatum;
  61.     /**
  62.      * @ORM\Column(type="boolean")
  63.      */
  64.     private $hideDatum;
  65.     /**
  66.      * @ORM\Column(type="boolean")
  67.      */
  68.     private $hideTitle;
  69.     /**
  70.      * @ORM\OneToMany(targetEntity="App\Entity\Picture", mappedBy="eventId")
  71.      */
  72.     private $pictures;
  73.     /**
  74.      * @ORM\Column(type="string", length=255)
  75.      */
  76.     private $machineName;
  77.     /**
  78.      * @ORM\Column(type="integer", nullable=true)
  79.      */
  80.     private $image;
  81.     public function __construct()
  82.     {
  83.         $this->city = new ArrayCollection();
  84.         $this->pictures = new ArrayCollection();
  85.         $this->datum = new \DateTime('now');
  86.     }
  87.     public function getId(): ?int
  88.     {
  89.         return $this->id;
  90.     }
  91.     public function getTitle(): ?string
  92.     {
  93.         return $this->title;
  94.     }
  95.     public function setTitle(string $title): self
  96.     {
  97.         $this->title $title;
  98.         return $this;
  99.     }
  100.     public function getDatum(): ?\DateTimeInterface
  101.     {
  102.         return $this->datum;
  103.     }
  104.     public function setDatum(\DateTimeInterface $datum): self
  105.     {
  106.         $this->datum $datum;
  107.         return $this;
  108.     }
  109.     public function getTime(): ?\DateTimeInterface
  110.     {
  111.         return $this->time;
  112.     }
  113.     public function setTime(?\DateTimeInterface $time): self
  114.     {
  115.         $this->time $time;
  116.         return $this;
  117.     }
  118.     /**
  119.      * @return Collection|Cities[]
  120.      */
  121.     public function getCity(): ?string
  122.     {
  123.         return $this->city;
  124.     }
  125.     public function setCity(?string $city): self
  126.     {
  127.         $this->city $city;
  128.         return $this;
  129.     }
  130.     public function getDescription(): ?string
  131.     {
  132.         return $this->description;
  133.     }
  134.     public function setDescription(?string $description): self
  135.     {
  136.         $this->description $description;
  137.         return $this;
  138.     }
  139.     public function getEventType(): ?EventType
  140.     {
  141.         return $this->eventType;
  142.     }
  143.     public function setEventType(?EventType $eventType): self
  144.     {
  145.         $this->eventType $eventType;
  146.         return $this;
  147.     }
  148.     public function getUrl(): ?string
  149.     {
  150.         return $this->url;
  151.     }
  152.     public function setUrl(?string $url): self
  153.     {
  154.         $this->url $url;
  155.         return $this;
  156.     }
  157.     public function getCaption(): ?string
  158.     {
  159.         return $this->caption;
  160.     }
  161.     public function setCaption(?string $caption): self
  162.     {
  163.         $this->caption $caption;
  164.         return $this;
  165.     }
  166.     public function getCityId(): ?Cities
  167.     {
  168.         return $this->cityId;
  169.     }
  170.     public function setCityId(?Cities $cityId): self
  171.     {
  172.         $this->cityId $cityId;
  173.         return $this;
  174.     }
  175.     public function getLanguage(): ?string
  176.     {
  177.         return $this->language;
  178.     }
  179.     public function setLanguage(?string $language): self
  180.     {
  181.         $this->language $language;
  182.         return $this;
  183.     }
  184.     public function getEndDatum(): ?\DateTimeInterface
  185.     {
  186.         return $this->endDatum;
  187.     }
  188.     public function setEndDatum(?\DateTimeInterface $endDatum): self
  189.     {
  190.         $this->endDatum $endDatum;
  191.         return $this;
  192.     }
  193.     public function getHideDatum(): ?bool
  194.     {
  195.         return $this->hideDatum;
  196.     }
  197.     public function setHideDatum(bool $hideDatum): self
  198.     {
  199.         $this->hideDatum $hideDatum;
  200.         return $this;
  201.     }
  202.     public function getHideTitle(): ?bool
  203.     {
  204.         return $this->hideTitle;
  205.     }
  206.     public function setHideTitle(bool $hideTitle): self
  207.     {
  208.         $this->hideTitle $hideTitle;
  209.         return $this;
  210.     }
  211.     /**
  212.      * @return Collection|Picture[]
  213.      */
  214.     public function getPictures(): Collection
  215.     {
  216.         return $this->pictures;
  217.     }
  218.     public function addPicture(Picture $picture): self
  219.     {
  220.         if (!$this->pictures->contains($picture)) {
  221.             $this->pictures[] = $picture;
  222.             $picture->setEventId($this);
  223.         }
  224.         return $this;
  225.     }
  226.     public function removePicture(Picture $picture): self
  227.     {
  228.         if ($this->pictures->contains($picture)) {
  229.             $this->pictures->removeElement($picture);
  230.             // set the owning side to null (unless already changed)
  231.             if ($picture->getEventId() === $this) {
  232.                 $picture->setEventId(null);
  233.             }
  234.         }
  235.         return $this;
  236.     }
  237.     /** {@inheritdoc} */
  238.     public function __toString()
  239.     {
  240.         return $this->getMachineName();
  241.     }
  242.     public function getMachineName(): ?string
  243.     {
  244.         return $this->machineName;
  245.     }
  246.     public function setMachineName(string $machineName): self
  247.     {
  248.         $this->machineName $machineName;
  249.         return $this;
  250.     }
  251.     public function getImage(): ?int
  252.     {
  253.         return $this->image;
  254.     }
  255.     public function setImage(?int $image): self
  256.     {
  257.         $this->image $image;
  258.         return $this;
  259.     }
  260. }