<?php
namespace App\Entity;
use App\Repository\CircuitRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=CircuitRepository::class)
*/
class Circuit
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=255)
*/
private $title;
/**
* @ORM\Column(type="string", length=255)
*/
private $short_description;
/**
* @ORM\Column(type="text")
*/
private $description;
/**
* @ORM\Column(type="string", length=255)
*/
private $difficulty;
/**
* @ORM\Column(type="float")
*/
private $distance;
/**
* @ORM\Column(type="float")
*/
private $duration;
/**
* @ORM\Column(type="float")
*/
private $priceWithBike;
/**
* @ORM\Column(type="float")
*/
private $priceWithoutBike;
/**
* @ORM\Column(type="string", length=255)
*/
private $banner;
/**
* @ORM\Column(type="string", length=255)
*/
private $image;
/**
* @ORM\Column(type="array")
*/
private $images = [];
/**
* @ORM\Column(type="text")
*/
private $map;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $alias;
/**
* @ORM\OneToMany(targetEntity=CircuitSite::class, mappedBy="circuit")
*/
private $circuitSites;
/**
* @ORM\OneToMany(targetEntity=Order::class, mappedBy="circuit")
*/
private $orders;
/**
* @ORM\Column(type="boolean", options={"default":"0"})
*/
private $statut = false;
/**
* @ORM\OneToMany(targetEntity=OrderCircuit::class, mappedBy="circuit")
*/
private $orderCircuits;
public function __construct()
{
$this->circuitSites = new ArrayCollection();
$this->orders = new ArrayCollection();
$this->orderCircuits = 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 getShortDescription(): ?string
{
return $this->short_description;
}
public function setShortDescription(string $short_description): self
{
$this->short_description = $short_description;
return $this;
}
public function getDescription(): ?string
{
return $this->description;
}
public function setDescription(string $description): self
{
$this->description = $description;
return $this;
}
public function getDifficulty(): ?string
{
return $this->difficulty;
}
public function setDifficulty(string $difficulty): self
{
$this->difficulty = $difficulty;
return $this;
}
public function getDistance(): ?float
{
return $this->distance;
}
public function setDistance(float $distance): self
{
$this->distance = $distance;
return $this;
}
public function getDuration(): ?float
{
return $this->duration;
}
public function setDuration(float $duration): self
{
$this->duration = $duration;
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 getBanner(): ?string
{
return $this->banner;
}
public function setBanner(string $banner): self
{
$this->banner = $banner;
return $this;
}
public function getImage(): ?string
{
return $this->image;
}
public function setImage(string $image): self
{
$this->image = $image;
return $this;
}
public function getImages(): ?array
{
return $this->images;
}
public function setImages(array $images): self
{
$this->images = $images;
return $this;
}
public function getMap(): ?string
{
return $this->map;
}
public function setMap(string $map): self
{
$this->map = $map;
return $this;
}
public function getAlias(): ?string
{
return $this->alias;
}
public function setAlias(string $alias): self
{
$this->alias = $alias;
return $this;
}
/**
* @return Collection<int, CircuitSite>
*/
public function getCircuitSites(): Collection
{
return $this->circuitSites;
}
public function addCircuitSite(CircuitSite $circuitSite): self
{
if (!$this->circuitSites->contains($circuitSite)) {
$this->circuitSites[] = $circuitSite;
$circuitSite->setCircuit($this);
}
return $this;
}
public function removeCircuitSite(CircuitSite $circuitSite): self
{
if ($this->circuitSites->removeElement($circuitSite)) {
// set the owning side to null (unless already changed)
if ($circuitSite->getCircuit() === $this) {
$circuitSite->setCircuit(null);
}
}
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->setCircuit($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->getCircuit() === $this) {
$order->setCircuit(null);
}
}
return $this;
}
public function isStatut(): ?bool
{
return $this->statut;
}
public function setStatut(bool $statut): self
{
$this->statut = $statut;
return $this;
}
/**
* @return Collection<int, OrderCircuit>
*/
public function getOrderCircuits(): Collection
{
return $this->orderCircuits;
}
public function addOrderCircuit(OrderCircuit $orderCircuit): self
{
if (!$this->orderCircuits->contains($orderCircuit)) {
$this->orderCircuits[] = $orderCircuit;
$orderCircuit->setCircuit($this);
}
return $this;
}
public function removeOrderCircuit(OrderCircuit $orderCircuit): self
{
if ($this->orderCircuits->removeElement($orderCircuit)) {
// set the owning side to null (unless already changed)
if ($orderCircuit->getCircuit() === $this) {
$orderCircuit->setCircuit(null);
}
}
return $this;
}
}