<?php
namespace App\Entity;
use App\Repository\LignesRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=LignesRepository::class)
*/
class Lignes
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="integer", nullable=true)
*/
private $Ordre;
/**
* @ORM\ManyToOne(targetEntity=Sections::class, inversedBy="lignes")
*/
private $Sections;
/**
* @ORM\OneToMany(targetEntity=Blocs::class, mappedBy="Lignes")
*/
private $blocs;
public function __construct()
{
$this->blocs = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getOrdre(): ?int
{
return $this->Ordre;
}
public function setOrdre(?int $Ordre): self
{
$this->Ordre = $Ordre;
return $this;
}
public function getSections(): ?Sections
{
return $this->Sections;
}
public function setSections(?Sections $Sections): self
{
$this->Sections = $Sections;
return $this;
}
/**
* @return Collection<int, Blocs>
*/
public function getBlocs(): Collection
{
return $this->blocs;
}
public function addBloc(Blocs $bloc): self
{
if (!$this->blocs->contains($bloc)) {
$this->blocs[] = $bloc;
$bloc->setLignes($this);
}
return $this;
}
public function removeBloc(Blocs $bloc): self
{
if ($this->blocs->removeElement($bloc)) {
// set the owning side to null (unless already changed)
if ($bloc->getLignes() === $this) {
$bloc->setLignes(null);
}
}
return $this;
}
}