<?php
namespace App\Entity;
use App\Repository\EnterpriseRequestRepository;
use DateTime;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=EnterpriseRequestRepository::class)
*/
class EnterpriseRequest
{
const STATE_REJECTED = "rejected";
const STATE_ACCEPTED = "accepted";
const STATUS_OPEN = "open";
const STATUS_REJECTED = "rejected";
const STATUS_ACCEPTED = "accepted";
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\ManyToOne(targetEntity=Enterprise::class, inversedBy="enterpriseRequests",cascade={"persist"})
* @ORM\JoinColumn(nullable=false)
*/
private $enterprise;
/**
* @ORM\OneToMany(targetEntity=EnterpriseOptionSejourSession::class, mappedBy="enterpriseRequest")
*/
private $enterpriseOptionSejourSessions;
/**
* @ORM\Column(type="datetime")
*/
private $creationDate;
/**
* @ORM\Column(type="string", length=255, nullable = true)
*/
private $type;
/**
* @ORM\ManyToOne(targetEntity=Saison::class)
* @ORM\JoinColumn(nullable=false)
*/
private $saison;
/**
* @ORM\Column(type="integer")
*/
private $ageMin;
/**
* @ORM\Column(type="integer")
*/
private $ageMax;
/**
* @ORM\Column(type="integer")
*/
private $nbr;
/**
* @ORM\Column(type="json", length=255, nullable = true)
*/
private $hebergement;
/**
* @ORM\Column(type="string", length=255, nullable = true)
*/
private $transport;
/**
* @ORM\Column(type="string", length=50, nullable=true)
*/
private $statut;
public function __construct()
{
$this->creationDate = new \DateTime();
$this->statut = self::STATUS_OPEN;
$this->hebergement = [];
$this->enterpriseOptionSejourSessions = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getEnterprise(): ?Enterprise
{
return $this->enterprise;
}
public function setEnterprise(?Enterprise $enterprise): self
{
$this->enterprise = $enterprise;
return $this;
}
public function getCreationDate(): ?\DateTimeInterface
{
return $this->creationDate;
}
public function setCreationDate(\DateTimeInterface $creationDate): self
{
$this->creationDate = $creationDate;
return $this;
}
public function getType(): ?string
{
return $this->type;
}
public function setType(string $type): self
{
$this->type = $type;
return $this;
}
public function getSaison(): ?Saison
{
return $this->saison;
}
public function setSaison(?Saison $saison): self
{
$this->saison = $saison;
return $this;
}
public function getAgeMin(): ?int
{
return $this->ageMin;
}
public function setAgeMin(int $ageMin): self
{
$this->ageMin = $ageMin;
return $this;
}
public function getAgeMax(): ?int
{
return $this->ageMax;
}
public function setAgeMax(int $ageMax): self
{
$this->ageMax = $ageMax;
return $this;
}
public function getNbr(): ?int
{
return $this->nbr;
}
public function setNbr(int $nbr): self
{
$this->nbr = $nbr;
return $this;
}
public function getHebergement()
{
return $this->hebergement;
}
public function setHebergement(string $hebergement): self
{
$this->hebergement = $hebergement;
return $this;
}
public function getTransport(): ?string
{
return $this->transport;
}
public function setTransport(string $transport): self
{
$this->transport = $transport;
return $this;
}
public function getStatut(): ?string
{
return $this->statut;
}
public function setStatut(?string $statut): self
{
$this->statut = $statut;
return $this;
}
/**
* @return Collection|EnterpriseOptionSejourSession[]
*/
public function getEnterpriseOptionSejourSessions()
{
return $this->enterpriseOptionSejourSessions;
}
public function addEnterpriseOptionSejourSession(EnterpriseOptionSejourSession $enterpriseOptionSejourSession): self
{
if (!$this->enterpriseOptionSejourSessions->contains($enterpriseOptionSejourSession)) {
$this->enterpriseOptionSejourSessions[] = $enterpriseOptionSejourSession;
$enterpriseOptionSejourSession->setEnterpriseRequest($this);
}
return $this;
}
public function removeEnterpriseOptionSejourSession(EnterpriseOptionSejourSession $enterpriseOptionSejourSession): self
{
if ($this->enterpriseOptionSejourSessions->removeElement($enterpriseOptionSejourSession)) {
// set the owning side to null (unless already changed)
if ($enterpriseOptionSejourSession->getEnterprise() === $this) {
$enterpriseOptionSejourSession->setEnterprise(null);
}
}
return $this;
}
}