<?php
namespace App\Entity;
use App\Repository\PromotionRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=PromotionRepository::class)
*/
class Promotion
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=50)
*/
private $prm_nom;
/**
* @ORM\Column(type="float")
*/
private $prm_reduction;
/**
* @ORM\ManyToOne(targetEntity=CentreGroupe::class, inversedBy="promotions")
* @ORM\JoinColumn(nullable=false)
*/
private $centre_groupe;
/**
* @ORM\OneToMany(targetEntity=PromotionCreneau::class, mappedBy="promotion")
*/
private $promotionCreneaus;
/**
* @ORM\ManyToMany(targetEntity=CentrePrestation::class, mappedBy="promotion_prestation", fetch="EAGER")
*/
private $centrePrestations;
/**
* @ORM\Column(type="integer", nullable=true)
*/
private $id_old;
/**
* @ORM\OneToMany(targetEntity=Rendezvous::class, mappedBy="promotion")
*/
private $rendezvouses;
public function __construct()
{
$this->promotionCreneaus = new ArrayCollection();
$this->centrePrestations = new ArrayCollection();
$this->rendezvouses = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getPrmNom(): ?string
{
return $this->prm_nom;
}
public function setPrmNom(string $prm_nom): self
{
$this->prm_nom = $prm_nom;
return $this;
}
public function getPrmReduction(): ?float
{
return $this->prm_reduction;
}
public function setPrmReduction(float $prm_reduction): self
{
$this->prm_reduction = $prm_reduction;
return $this;
}
public function getCentreGroupe(): ?CentreGroupe
{
return $this->centre_groupe;
}
public function setCentreGroupe(?CentreGroupe $prm_centre_groupe): self
{
$this->centre_groupe = $prm_centre_groupe;
return $this;
}
/**
* @return Collection<int, PromotionCreneau>
*/
public function getPromotionCreneaus(): Collection
{
return $this->promotionCreneaus;
}
public function addPromotionCreneau(PromotionCreneau $promotionCreneau): self
{
if (!$this->promotionCreneaus->contains($promotionCreneau)) {
$this->promotionCreneaus[] = $promotionCreneau;
$promotionCreneau->setPromotion($this);
}
return $this;
}
public function removePromotionCreneau(PromotionCreneau $promotionCreneau): self
{
if ($this->promotionCreneaus->removeElement($promotionCreneau)) {
// set the owning side to null (unless already changed)
if ($promotionCreneau->getPromotion() === $this) {
$promotionCreneau->setPromotion(null);
}
}
return $this;
}
/**
* @return Collection<int, CentrePrestation>
*/
public function getCentrePrestations(): Collection
{
return $this->centrePrestations;
}
public function addCentrePrestation(CentrePrestation $centrePrestation): self
{
if (!$this->centrePrestations->contains($centrePrestation)) {
$this->centrePrestations[] = $centrePrestation;
$centrePrestation->addPromotionPrestation($this);
}
return $this;
}
public function removeCentrePrestation(CentrePrestation $centrePrestation): self
{
if ($this->centrePrestations->removeElement($centrePrestation)) {
$centrePrestation->removePromotionPrestation($this);
}
return $this;
}
public function getIdOld(): ?int
{
return $this->id_old;
}
public function setIdOld(int $id_old): self
{
$this->id_old = $id_old;
return $this;
}
/**
* @return Collection<int, Rendezvous>
*/
public function getRendezvouses(): Collection
{
return $this->rendezvouses;
}
public function addRendezvouse(Rendezvous $rendezvouse): self
{
if (!$this->rendezvouses->contains($rendezvouse)) {
$this->rendezvouses[] = $rendezvouse;
$rendezvouse->setPromotion($this);
}
return $this;
}
public function removeRendezvouse(Rendezvous $rendezvouse): self
{
if ($this->rendezvouses->removeElement($rendezvouse)) {
// set the owning side to null (unless already changed)
if ($rendezvouse->getPromotion() === $this) {
$rendezvouse->setPromotion(null);
}
}
return $this;
}
}