src/Entity/BCModele.php line 11

  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\BCModeleRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. #[ORM\Entity(repositoryClassBCModeleRepository::class)]
  8. class BCModele
  9. {
  10.     #[ORM\Id]
  11.     #[ORM\GeneratedValue]
  12.     #[ORM\Column]
  13.     private ?int $id null;
  14.     #[ORM\Column(length255)]
  15.     private ?string $name null;
  16.     #[ORM\ManyToOne(inversedBy'BCModeles')]
  17.     #[ORM\JoinColumn(nullablefalse)]
  18.     private ?BCType $BCType null;
  19.     #[ORM\OneToMany(mappedBy'BCModele'targetEntityBCFacteur::class, orphanRemovaltrue)]
  20.     private Collection $BCFacteurs;
  21.     public function __construct()
  22.     {
  23.         $this->BCFacteurs = new ArrayCollection();
  24.     }
  25.     public function getId(): ?int
  26.     {
  27.         return $this->id;
  28.     }
  29.     public function getName(): ?string
  30.     {
  31.         return $this->name;
  32.     }
  33.     public function setName(string $name): self
  34.     {
  35.         $this->name $name;
  36.         return $this;
  37.     }
  38.     public function getBCType(): ?BCType
  39.     {
  40.         return $this->BCType;
  41.     }
  42.     public function setBCType(?BCType $BCType): self
  43.     {
  44.         $this->BCType $BCType;
  45.         return $this;
  46.     }
  47.     public function getLastFacteur(): ?BCFacteur
  48.     {
  49.         return $this->BCFacteurs->last();
  50.     }
  51.     /**
  52.      * @return Collection<int, BCFacteur>
  53.      */
  54.     public function getBCFacteurs(): Collection
  55.     {
  56.         return $this->BCFacteurs;
  57.     }
  58.     public function addBCFacteur(BCFacteur $bCFacteur): self
  59.     {
  60.         if (!$this->BCFacteurs->contains($bCFacteur)) {
  61.             $this->BCFacteurs->add($bCFacteur);
  62.             $bCFacteur->setBCModele($this);
  63.         }
  64.         return $this;
  65.     }
  66.     public function removeBCFacteur(BCFacteur $bCFacteur): self
  67.     {
  68.         if ($this->BCFacteurs->removeElement($bCFacteur)) {
  69.             // set the owning side to null (unless already changed)
  70.             if ($bCFacteur->getBCModele() === $this) {
  71.                 $bCFacteur->setBCModele(null);
  72.             }
  73.         }
  74.         return $this;
  75.     }
  76. }