src/Entity/PropositionOrigine.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\PropositionOrigineRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. #[ORM\Entity(repositoryClassPropositionOrigineRepository::class)]
  8. class PropositionOrigine
  9. {
  10.     #[ORM\Id]
  11.     #[ORM\GeneratedValue]
  12.     #[ORM\Column(type'integer')]
  13.     private $id;
  14.     #[ORM\Column(type'string'length255nullabletrue)]
  15.     private $libelleCourt;
  16.     #[ORM\Column(type'string'length255nullabletrue)]
  17.     private $libelleLong;
  18.     #[ORM\OneToMany(targetEntityProposition::class, mappedBy'origine'cascade: ['persist'])]
  19.     private $propositions;
  20.     public function __toString()
  21.     {
  22.         return $this->getLibelleLong();
  23.     }
  24.     public function __construct()
  25.     {
  26.         $this->propositions = new ArrayCollection();
  27.     }
  28.     public function getId(): ?int
  29.     {
  30.         return $this->id;
  31.     }
  32.     public function getLibelleCourt(): ?string
  33.     {
  34.         return $this->libelleCourt;
  35.     }
  36.     public function setLibelleCourt(?string $libelleCourt): self
  37.     {
  38.         $this->libelleCourt $libelleCourt;
  39.         return $this;
  40.     }
  41.     public function getLibelleLong(): ?string
  42.     {
  43.         return $this->libelleLong;
  44.     }
  45.     public function setLibelleLong(?string $libelleLong): self
  46.     {
  47.         $this->libelleLong $libelleLong;
  48.         return $this;
  49.     }
  50.     /**
  51.      * @return Collection|Proposition[]
  52.      */
  53.     public function getPropositions(): Collection
  54.     {
  55.         return $this->propositions;
  56.     }
  57.     public function addProposition(Proposition $proposition): self
  58.     {
  59.         if (!$this->propositions->contains($proposition)) {
  60.             $this->propositions[] = $proposition;
  61.             $proposition->setOrigine($this);
  62.         }
  63.         return $this;
  64.     }
  65.     public function removeProposition(Proposition $proposition): self
  66.     {
  67.         if ($this->propositions->removeElement($proposition)) {
  68.             // set the owning side to null (unless already changed)
  69.             if ($proposition->getOrigine() === $this) {
  70.                 $proposition->setOrigine(null);
  71.             }
  72.         }
  73.         return $this;
  74.     }
  75. }