src/Entity/Events.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\Common\Collections\ArrayCollection;
  4. use Doctrine\Common\Collections\Collection;
  5. use App\Repository\EventsRepository;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8.  * @ORM\Entity(repositoryClass=EventsRepository::class)
  9.  */
  10. class Events
  11. {
  12.     public function __construct(){
  13.                           $this->createdAt = new \DateTime;
  14.                           $this->date = new \DateTime;
  15.                           $this->isEnabled false;
  16.                           $this->tags = new ArrayCollection();
  17.                       }
  18.     /**
  19.      * @ORM\Id
  20.      * @ORM\GeneratedValue
  21.      * @ORM\Column(type="integer")
  22.      */
  23.     private $id;
  24.     /**
  25.      * @ORM\Column(type="date", nullable=true)
  26.      */
  27.     private $startDate;
  28.     /**
  29.      * @ORM\Column(type="time", nullable=true)
  30.      */
  31.     private $startTime;
  32.     /**
  33.      * @ORM\Column(type="date", nullable=true)
  34.      */
  35.     private $endDate;
  36.     /**
  37.      * @ORM\Column(type="time", nullable=true)
  38.      */
  39.     private $endTime;
  40.     /**
  41.      * @ORM\Column(type="string", length=255, nullable=true)
  42.      */
  43.     private $name;
  44.     /**
  45.      * @ORM\Column(type="text", nullable=true)
  46.      */
  47.     private $description;
  48.     /**
  49.      * @ORM\Column(type="text", nullable=true)
  50.      */
  51.     private $details;
  52.     /**
  53.      * @ORM\Column(type="datetime", nullable=true)
  54.      */
  55.     private $createdAt;
  56.     /**
  57.      * @ORM\ManyToOne(targetEntity=Users::class)
  58.      */
  59.     private $createdBy;
  60.     /**
  61.      * @ORM\Column(type="boolean", nullable=true)
  62.      */
  63.     private $isEnabled;
  64.     /**
  65.      * @ORM\Column(type="datetime", nullable=true)
  66.      */
  67.     private $date;
  68.     /**
  69.      * @ORM\OneToOne(targetEntity="App\Entity\Albums", cascade={"persist","remove"}, orphanRemoval=true, fetch="EAGER")
  70.      * @ORM\JoinColumn(nullable=true)
  71.      */
  72.     private $album;
  73.     /**
  74.      * @ORM\OneToOne(targetEntity="App\Entity\Biblios", cascade={"persist","remove"}, orphanRemoval=true, fetch="EAGER")
  75.      * @ORM\JoinColumn(nullable=true)
  76.      */
  77.     private $biblio;
  78.     /**
  79.      * @ORM\ManyToMany(targetEntity=Tags::class)
  80.      */
  81.     private $tags;
  82.     /**
  83.      * @ORM\OneToOne(targetEntity="App\Entity\Picture", cascade={"persist","remove"}, orphanRemoval=true, fetch="EAGER")
  84.      * @ORM\JoinColumn(nullable=true)
  85.      */
  86.     private $banner;
  87.     /**
  88.      * @ORM\Column(type="string", length=255, nullable=true)
  89.      */
  90.     private $slug;
  91.     /**
  92.      * @ORM\Column(type="string", length=255, nullable=true)
  93.      */
  94.     private $place;
  95.     public function getId(): ?int
  96.     {
  97.         return $this->id;
  98.     }
  99.     public function getStartDate(): ?\DateTimeInterface
  100.     {
  101.         return $this->startDate;
  102.     }
  103.     public function setStartDate(?\DateTimeInterface $startDate): self
  104.     {
  105.         $this->startDate $startDate;
  106.         return $this;
  107.     }
  108.     public function getStartTime(): ?\DateTimeInterface
  109.     {
  110.         return $this->startTime;
  111.     }
  112.     public function setStartTime(?\DateTimeInterface $startTime): self
  113.     {
  114.         $this->startTime $startTime;
  115.         return $this;
  116.     }
  117.     public function getEndDate(): ?\DateTimeInterface
  118.     {
  119.         return $this->endDate;
  120.     }
  121.     public function setEndDate(?\DateTimeInterface $endDate): self
  122.     {
  123.         $this->endDate $endDate;
  124.         return $this;
  125.     }
  126.     public function getEndTime(): ?\DateTimeInterface
  127.     {
  128.         return $this->endTime;
  129.     }
  130.     public function setEndTime(?\DateTimeInterface $endTime): self
  131.     {
  132.         $this->endTime $endTime;
  133.         return $this;
  134.     }
  135.     public function getName(): ?string
  136.     {
  137.         return $this->name;
  138.     }
  139.     public function setName(?string $name): self
  140.     {
  141.         $this->name $name;
  142.         return $this;
  143.     }
  144.     public function getDescription(): ?string
  145.     {
  146.         return $this->description;
  147.     }
  148.     public function setDescription(?string $description): self
  149.     {
  150.         $this->description $description;
  151.         return $this;
  152.     }
  153.     public function getDetails(): ?string
  154.     {
  155.         return $this->details;
  156.     }
  157.     public function setDetails(?string $details): self
  158.     {
  159.         $this->details $details;
  160.         return $this;
  161.     }
  162.     public function getCreatedAt(): ?\DateTimeInterface
  163.     {
  164.         return $this->createdAt;
  165.     }
  166.     public function setCreatedAt(?\DateTimeInterface $createdAt): self
  167.     {
  168.         $this->createdAt $createdAt;
  169.         return $this;
  170.     }
  171.     public function getCreatedBy(): ?Users
  172.     {
  173.         return $this->createdBy;
  174.     }
  175.     public function setCreatedBy(?Users $createdBy): self
  176.     {
  177.         $this->createdBy $createdBy;
  178.         return $this;
  179.     }
  180.     public function getIsEnabled(): ?bool
  181.     {
  182.         return $this->isEnabled;
  183.     }
  184.     public function setIsEnabled(?bool $isEnabled): self
  185.     {
  186.         $this->isEnabled $isEnabled;
  187.         return $this;
  188.     }
  189.     public function getDate(): ?\DateTimeInterface
  190.     {
  191.         return $this->date;
  192.     }
  193.     public function setDate(?\DateTimeInterface $date): self
  194.     {
  195.         $this->date $date;
  196.         return $this;
  197.     }
  198.     public function getAlbum(): ?Albums
  199.     {
  200.         return $this->album;
  201.     }
  202.     public function setAlbum(?Albums $album): self
  203.     {
  204.         $this->album $album;
  205.         return $this;
  206.     }
  207.     public function getBiblio(): ?Biblios
  208.     {
  209.         return $this->biblio;
  210.     }
  211.     public function setBiblio(?Biblios $biblio): self
  212.     {
  213.         $this->biblio $biblio;
  214.         return $this;
  215.     }
  216.     /**
  217.      * @return Collection|Tags[]
  218.      */
  219.     public function getTags(): Collection
  220.     {
  221.         return $this->tags;
  222.     }
  223.     public function addTag(Tags $tag): self
  224.     {
  225.         if (!$this->tags->contains($tag)) {
  226.             $this->tags[] = $tag;
  227.         }
  228.         return $this;
  229.     }
  230.     public function removeTag(Tags $tag): self
  231.     {
  232.         $this->tags->removeElement($tag);
  233.         return $this;
  234.     }
  235.     public function getBanner(): ?Picture
  236.     {
  237.         return $this->banner;
  238.     }
  239.     public function setBanner(?Picture $banner): self
  240.     {
  241.         if($banner->getTarget()){
  242.             $this->banner $banner;
  243.             $this->banner->setDir('upload/images/articles/');
  244.             $this->banner->setThumbnailDir('upload/thumbnails/articles/');
  245.         }
  246.         return $this;
  247.     }
  248.     public function getSlug(): ?string
  249.     {
  250.         return $this->slug;
  251.     }
  252.     public function setSlug(?string $slug): self
  253.     {
  254.         $this->slug $slug;
  255.         return $this;
  256.     }
  257.     public function getPlace(): ?string
  258.     {
  259.         return $this->place;
  260.     }
  261.     public function setPlace(?string $place): self
  262.     {
  263.         $this->place $place;
  264.         return $this;
  265.     }
  266. }