<?php
namespace App\Entity;
use App\Repository\LigneBlocageRecurrenceRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=LigneBlocageRecurrenceRepository::class)
*/
class LigneBlocageRecurrence
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\OneToMany(targetEntity=LigneBlocage::class, mappedBy="recurrence")
*/
private $ligneBlocages;
/**
* @ORM\Column(type="integer", nullable=true)
*/
private $id_old;
public function __construct()
{
$this->ligneBlocages = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
/**
* @return Collection<int, LigneBlocage>
*/
public function getLigneBlocages(): Collection
{
return $this->ligneBlocages;
}
public function addLigneBlocage(LigneBlocage $ligneBlocage): self
{
if (!$this->ligneBlocages->contains($ligneBlocage)) {
$this->ligneBlocages[] = $ligneBlocage;
$ligneBlocage->setRecurrence($this);
}
return $this;
}
public function removeLigneBlocage(LigneBlocage $ligneBlocage): self
{
if ($this->ligneBlocages->removeElement($ligneBlocage)) {
// set the owning side to null (unless already changed)
if ($ligneBlocage->getRecurrence() === $this) {
$ligneBlocage->setRecurrence(null);
}
}
return $this;
}
public function getIdOld(): ?int
{
return $this->id_old;
}
public function setIdOld(int $id_old): self
{
$this->id_old = $id_old;
return $this;
}
}