<?php
namespace App\Entity;
use App\Repository\EventRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;
/**
* @ORM\Entity(repositoryClass=EventRepository::class)
*/
class Event
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=255)
*/
private $title;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $description;
/**
* @ORM\Column(type="text")
*/
private $detailed_description;
/**
* @ORM\Column(type="string", length=255)
*/
private $principal_image;
/**
* @ORM\Column(type="array")
*/
private $multiple_image = [];
/**
* @ORM\Column(type="string", length=255)
*/
private $banner;
/**
* @ORM\Column(type="datetime")
*/
private $start;
/**
* @ORM\Column(type="datetime")
*/
private $end;
/**
* @ORM\Column(type="string", length=255)
*/
private $difficulty;
/**
* @ORM\Column(type="float")
*/
private $priceWithBike;
/**
* @ORM\Column(type="float")
*/
private $priceWithoutBike;
/**
* @ORM\Column(type="integer")
*/
private $journey;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $alias;
/**
* @ORM\Column(type="boolean")
*/
private $statut;
/**
* @ORM\ManyToOne(targetEntity=Agency::class, inversedBy="events")
*/
private $agency;
/**
* @ORM\OneToMany(targetEntity=Order::class, mappedBy="event")
*/
private $orders;
/**
* @ORM\Column(type="datetime_immutable")
* @Gedmo\Timestampable(on="create")
*/
private $created_at;
/**
* @ORM\Column(type="datetime_immutable")
* @Gedmo\Timestampable(on="update")
*/
private $updated_at;
public function __construct()
{
$this->orders = new ArrayCollection();
}
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 getDescription(): ?string
{
return $this->description;
}
public function setDescription(?string $description): self
{
$this->description = $description;
return $this;
}
public function getDetailedDescription(): ?string
{
return $this->detailed_description;
}
public function setDetailedDescription(string $detailed_description): self
{
$this->detailed_description = $detailed_description;
return $this;
}
public function getPrincipalImage(): ?string
{
return $this->principal_image;
}
public function setPrincipalImage(string $principal_image): self
{
$this->principal_image = $principal_image;
return $this;
}
public function getMultipleImage(): ?array
{
return $this->multiple_image;
}
public function setMultipleImage(array $multiple_image): self
{
$this->multiple_image = $multiple_image;
return $this;
}
public function getBanner(): ?string
{
return $this->banner;
}
public function setBanner(string $banner): self
{
$this->banner = $banner;
return $this;
}
public function getStart(): ?\DateTimeInterface
{
return $this->start;
}
public function setStart(\DateTimeInterface $start): self
{
$this->start = $start;
return $this;
}
public function getEnd(): ?\DateTimeInterface
{
return $this->end;
}
public function setEnd(\DateTimeInterface $end): self
{
$this->end = $end;
return $this;
}
public function getDifficulty(): ?string
{
return $this->difficulty;
}
public function setDifficulty(string $difficulty): self
{
$this->difficulty = $difficulty;
return $this;
}
public function getPriceWithBike(): ?float
{
return $this->priceWithBike;
}
public function setPriceWithBike(float $priceWithBike): self
{
$this->priceWithBike = $priceWithBike;
return $this;
}
public function getPriceWithoutBike(): ?float
{
return $this->priceWithoutBike;
}
public function setPriceWithoutBike(string $priceWithoutBike): self
{
$this->priceWithoutBike = $priceWithoutBike;
return $this;
}
public function getJourney(): ?int
{
return $this->journey;
}
public function setJourney(int $journey): self
{
$this->journey = $journey;
return $this;
}
public function getAlias(): ?string
{
return $this->alias;
}
public function setAlias(string $alias): self
{
$this->alias = $alias;
return $this;
}
public function isStatut(): ?bool
{
return $this->statut;
}
public function setStatut(bool $statut): self
{
$this->statut = $statut;
return $this;
}
public function getAgency(): ?Agency
{
return $this->agency;
}
public function setAgency(?Agency $agency): self
{
$this->agency = $agency;
return $this;
}
/**
* @return Collection<int, Order>
*/
public function getOrders(): Collection
{
return $this->orders;
}
public function addOrder(Order $order): self
{
if (!$this->orders->contains($order)) {
$this->orders[] = $order;
$order->setEvents($this);
}
return $this;
}
public function removeOrder(Order $order): self
{
if ($this->orders->removeElement($order)) {
// set the owning side to null (unless already changed)
if ($order->getEvents() === $this) {
$order->setEvents(null);
}
}
return $this;
}
public function getCreatedAt(): ?\DateTimeImmutable
{
return $this->created_at;
}
public function setCreatedAt(\DateTimeImmutable $created_at): self
{
$this->created_at = $created_at;
return $this;
}
public function getUpdatedAt(): ?\DateTimeImmutable
{
return $this->updated_at;
}
public function setUpdatedAt(\DateTimeImmutable $updated_at): self
{
$this->updated_at = $updated_at;
return $this;
}
}