<?php
namespace App\Entity;
use App\Repository\PropositionOrigineRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: PropositionOrigineRepository::class)]
class PropositionOrigine
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column(type: 'integer')]
private $id;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $libelleCourt;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $libelleLong;
#[ORM\OneToMany(targetEntity: Proposition::class, mappedBy: 'origine', cascade: ['persist'])]
private $propositions;
public function __toString()
{
return $this->getLibelleLong();
}
public function __construct()
{
$this->propositions = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getLibelleCourt(): ?string
{
return $this->libelleCourt;
}
public function setLibelleCourt(?string $libelleCourt): self
{
$this->libelleCourt = $libelleCourt;
return $this;
}
public function getLibelleLong(): ?string
{
return $this->libelleLong;
}
public function setLibelleLong(?string $libelleLong): self
{
$this->libelleLong = $libelleLong;
return $this;
}
/**
* @return Collection|Proposition[]
*/
public function getPropositions(): Collection
{
return $this->propositions;
}
public function addProposition(Proposition $proposition): self
{
if (!$this->propositions->contains($proposition)) {
$this->propositions[] = $proposition;
$proposition->setOrigine($this);
}
return $this;
}
public function removeProposition(Proposition $proposition): self
{
if ($this->propositions->removeElement($proposition)) {
// set the owning side to null (unless already changed)
if ($proposition->getOrigine() === $this) {
$proposition->setOrigine(null);
}
}
return $this;
}
}