<?php
namespace App\Entity;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass="App\Repository\EventsRepository")
*/
class Events
{
/**
* @ORM\Id()
* @ORM\GeneratedValue()
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $title;
/**
* @ORM\Column(type="date", nullable=true)
*/
private $datum;
/**
* @ORM\Column(type="time", nullable=true)
*/
private $time;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $city;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $description;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\EventType", inversedBy="events")
*/
private $eventType;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $url;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $caption;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\Cities", inversedBy="events")
*/
private $cityId;
/**
* @ORM\Column(type="string", length=2, nullable=true)
*/
private $language;
/**
* @ORM\Column(type="date", nullable=true)
*/
private $endDatum;
/**
* @ORM\Column(type="boolean")
*/
private $hideDatum;
/**
* @ORM\Column(type="boolean")
*/
private $hideTitle;
/**
* @ORM\OneToMany(targetEntity="App\Entity\Picture", mappedBy="eventId")
*/
private $pictures;
/**
* @ORM\Column(type="string", length=255)
*/
private $machineName;
/**
* @ORM\Column(type="integer", nullable=true)
*/
private $image;
public function __construct()
{
$this->city = new ArrayCollection();
$this->pictures = new ArrayCollection();
$this->datum = new \DateTime('now');
}
public function getId(): ?int
{
return $this->id;
}
public function getTitle(): ?string
{
return $this->title;
}
public function setTitle(string $title): self
{
$this->title = $title;
return $this;
}
public function getDatum(): ?\DateTimeInterface
{
return $this->datum;
}
public function setDatum(\DateTimeInterface $datum): self
{
$this->datum = $datum;
return $this;
}
public function getTime(): ?\DateTimeInterface
{
return $this->time;
}
public function setTime(?\DateTimeInterface $time): self
{
$this->time = $time;
return $this;
}
/**
* @return Collection|Cities[]
*/
public function getCity(): ?string
{
return $this->city;
}
public function setCity(?string $city): self
{
$this->city = $city;
return $this;
}
public function getDescription(): ?string
{
return $this->description;
}
public function setDescription(?string $description): self
{
$this->description = $description;
return $this;
}
public function getEventType(): ?EventType
{
return $this->eventType;
}
public function setEventType(?EventType $eventType): self
{
$this->eventType = $eventType;
return $this;
}
public function getUrl(): ?string
{
return $this->url;
}
public function setUrl(?string $url): self
{
$this->url = $url;
return $this;
}
public function getCaption(): ?string
{
return $this->caption;
}
public function setCaption(?string $caption): self
{
$this->caption = $caption;
return $this;
}
public function getCityId(): ?Cities
{
return $this->cityId;
}
public function setCityId(?Cities $cityId): self
{
$this->cityId = $cityId;
return $this;
}
public function getLanguage(): ?string
{
return $this->language;
}
public function setLanguage(?string $language): self
{
$this->language = $language;
return $this;
}
public function getEndDatum(): ?\DateTimeInterface
{
return $this->endDatum;
}
public function setEndDatum(?\DateTimeInterface $endDatum): self
{
$this->endDatum = $endDatum;
return $this;
}
public function getHideDatum(): ?bool
{
return $this->hideDatum;
}
public function setHideDatum(bool $hideDatum): self
{
$this->hideDatum = $hideDatum;
return $this;
}
public function getHideTitle(): ?bool
{
return $this->hideTitle;
}
public function setHideTitle(bool $hideTitle): self
{
$this->hideTitle = $hideTitle;
return $this;
}
/**
* @return Collection|Picture[]
*/
public function getPictures(): Collection
{
return $this->pictures;
}
public function addPicture(Picture $picture): self
{
if (!$this->pictures->contains($picture)) {
$this->pictures[] = $picture;
$picture->setEventId($this);
}
return $this;
}
public function removePicture(Picture $picture): self
{
if ($this->pictures->contains($picture)) {
$this->pictures->removeElement($picture);
// set the owning side to null (unless already changed)
if ($picture->getEventId() === $this) {
$picture->setEventId(null);
}
}
return $this;
}
/** {@inheritdoc} */
public function __toString()
{
return $this->getMachineName();
}
public function getMachineName(): ?string
{
return $this->machineName;
}
public function setMachineName(string $machineName): self
{
$this->machineName = $machineName;
return $this;
}
public function getImage(): ?int
{
return $this->image;
}
public function setImage(?int $image): self
{
$this->image = $image;
return $this;
}
}