<?php
namespace App\Entity;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use App\Repository\EventsRepository;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=EventsRepository::class)
*/
class Events
{
public function __construct(){
$this->createdAt = new \DateTime;
$this->date = new \DateTime;
$this->isEnabled = false;
$this->tags = new ArrayCollection();
}
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="date", nullable=true)
*/
private $startDate;
/**
* @ORM\Column(type="time", nullable=true)
*/
private $startTime;
/**
* @ORM\Column(type="date", nullable=true)
*/
private $endDate;
/**
* @ORM\Column(type="time", nullable=true)
*/
private $endTime;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $name;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $description;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $details;
/**
* @ORM\Column(type="datetime", nullable=true)
*/
private $createdAt;
/**
* @ORM\ManyToOne(targetEntity=Users::class)
*/
private $createdBy;
/**
* @ORM\Column(type="boolean", nullable=true)
*/
private $isEnabled;
/**
* @ORM\Column(type="datetime", nullable=true)
*/
private $date;
/**
* @ORM\OneToOne(targetEntity="App\Entity\Albums", cascade={"persist","remove"}, orphanRemoval=true, fetch="EAGER")
* @ORM\JoinColumn(nullable=true)
*/
private $album;
/**
* @ORM\OneToOne(targetEntity="App\Entity\Biblios", cascade={"persist","remove"}, orphanRemoval=true, fetch="EAGER")
* @ORM\JoinColumn(nullable=true)
*/
private $biblio;
/**
* @ORM\ManyToMany(targetEntity=Tags::class)
*/
private $tags;
/**
* @ORM\OneToOne(targetEntity="App\Entity\Picture", cascade={"persist","remove"}, orphanRemoval=true, fetch="EAGER")
* @ORM\JoinColumn(nullable=true)
*/
private $banner;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $slug;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $place;
public function getId(): ?int
{
return $this->id;
}
public function getStartDate(): ?\DateTimeInterface
{
return $this->startDate;
}
public function setStartDate(?\DateTimeInterface $startDate): self
{
$this->startDate = $startDate;
return $this;
}
public function getStartTime(): ?\DateTimeInterface
{
return $this->startTime;
}
public function setStartTime(?\DateTimeInterface $startTime): self
{
$this->startTime = $startTime;
return $this;
}
public function getEndDate(): ?\DateTimeInterface
{
return $this->endDate;
}
public function setEndDate(?\DateTimeInterface $endDate): self
{
$this->endDate = $endDate;
return $this;
}
public function getEndTime(): ?\DateTimeInterface
{
return $this->endTime;
}
public function setEndTime(?\DateTimeInterface $endTime): self
{
$this->endTime = $endTime;
return $this;
}
public function getName(): ?string
{
return $this->name;
}
public function setName(?string $name): self
{
$this->name = $name;
return $this;
}
public function getDescription(): ?string
{
return $this->description;
}
public function setDescription(?string $description): self
{
$this->description = $description;
return $this;
}
public function getDetails(): ?string
{
return $this->details;
}
public function setDetails(?string $details): self
{
$this->details = $details;
return $this;
}
public function getCreatedAt(): ?\DateTimeInterface
{
return $this->createdAt;
}
public function setCreatedAt(?\DateTimeInterface $createdAt): self
{
$this->createdAt = $createdAt;
return $this;
}
public function getCreatedBy(): ?Users
{
return $this->createdBy;
}
public function setCreatedBy(?Users $createdBy): self
{
$this->createdBy = $createdBy;
return $this;
}
public function getIsEnabled(): ?bool
{
return $this->isEnabled;
}
public function setIsEnabled(?bool $isEnabled): self
{
$this->isEnabled = $isEnabled;
return $this;
}
public function getDate(): ?\DateTimeInterface
{
return $this->date;
}
public function setDate(?\DateTimeInterface $date): self
{
$this->date = $date;
return $this;
}
public function getAlbum(): ?Albums
{
return $this->album;
}
public function setAlbum(?Albums $album): self
{
$this->album = $album;
return $this;
}
public function getBiblio(): ?Biblios
{
return $this->biblio;
}
public function setBiblio(?Biblios $biblio): self
{
$this->biblio = $biblio;
return $this;
}
/**
* @return Collection|Tags[]
*/
public function getTags(): Collection
{
return $this->tags;
}
public function addTag(Tags $tag): self
{
if (!$this->tags->contains($tag)) {
$this->tags[] = $tag;
}
return $this;
}
public function removeTag(Tags $tag): self
{
$this->tags->removeElement($tag);
return $this;
}
public function getBanner(): ?Picture
{
return $this->banner;
}
public function setBanner(?Picture $banner): self
{
if($banner->getTarget()){
$this->banner = $banner;
$this->banner->setDir('upload/images/articles/');
$this->banner->setThumbnailDir('upload/thumbnails/articles/');
}
return $this;
}
public function getSlug(): ?string
{
return $this->slug;
}
public function setSlug(?string $slug): self
{
$this->slug = $slug;
return $this;
}
public function getPlace(): ?string
{
return $this->place;
}
public function setPlace(?string $place): self
{
$this->place = $place;
return $this;
}
}