<?php
namespace App\Entity;
use App\Repository\ArrangementsRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=ArrangementsRepository::class)
*/
class Arrangements
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=255)
*/
private $name;
/**
* @ORM\Column(type="boolean")
*/
private $etat;
/**
* @ORM\OneToMany(targetEntity=Sejour::class, mappedBy="arrangement")
*/
private $sejours;
/**
* @ORM\OneToMany(targetEntity=Pricearrangement::class, mappedBy="arrangement", orphanRemoval=true)
*/
private $pricearrangements;
/**
* @ORM\OneToMany(targetEntity=Hotelarrangement::class, mappedBy="arrangement", orphanRemoval=true)
*/
private $hotelarrangements;
public function __construct()
{
$this->sejours = new ArrayCollection();
$this->pricearrangements = new ArrayCollection();
$this->hotelarrangements = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getName(): ?string
{
return $this->name;
}
public function setName(string $name): self
{
$this->name = $name;
return $this;
}
public function isEtat(): ?bool
{
return $this->etat;
}
public function setEtat(bool $etat): self
{
$this->etat = $etat;
return $this;
}
/**
* @return Collection<int, Sejour>
*/
public function getSejours(): Collection
{
return $this->sejours;
}
public function addSejour(Sejour $sejour): self
{
if (!$this->sejours->contains($sejour)) {
$this->sejours[] = $sejour;
$sejour->setArrangement($this);
}
return $this;
}
public function removeSejour(Sejour $sejour): self
{
if ($this->sejours->removeElement($sejour)) {
// set the owning side to null (unless already changed)
if ($sejour->getArrangement() === $this) {
$sejour->setArrangement(null);
}
}
return $this;
}
public function __toString()
{
return $this->name;
}
/**
* @return Collection<int, Pricearrangement>
*/
public function getPricearrangements(): Collection
{
return $this->pricearrangements;
}
public function addPricearrangement(Pricearrangement $pricearrangement): self
{
if (!$this->pricearrangements->contains($pricearrangement)) {
$this->pricearrangements[] = $pricearrangement;
$pricearrangement->setArrangement($this);
}
return $this;
}
public function removePricearrangement(Pricearrangement $pricearrangement): self
{
if ($this->pricearrangements->removeElement($pricearrangement)) {
// set the owning side to null (unless already changed)
if ($pricearrangement->getArrangement() === $this) {
$pricearrangement->setArrangement(null);
}
}
return $this;
}
/**
* @return Collection<int, Hotelarrangement>
*/
public function getHotelarrangements(): Collection
{
return $this->hotelarrangements;
}
public function addHotelarrangement(Hotelarrangement $hotelarrangement): self
{
if (!$this->hotelarrangements->contains($hotelarrangement)) {
$this->hotelarrangements[] = $hotelarrangement;
$hotelarrangement->setArrangement($this);
}
return $this;
}
public function removeHotelarrangement(Hotelarrangement $hotelarrangement): self
{
if ($this->hotelarrangements->removeElement($hotelarrangement)) {
// set the owning side to null (unless already changed)
if ($hotelarrangement->getArrangement() === $this) {
$hotelarrangement->setArrangement(null);
}
}
return $this;
}
}