src/Entity/BCType.php line 11

  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\BCTypeRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. #[ORM\Entity(repositoryClassBCTypeRepository::class)]
  8. class BCType
  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'BCTypes')]
  17.     #[ORM\JoinColumn(nullablefalse)]
  18.     private ?BCFamille $BCFamille null;
  19.     #[ORM\OneToMany(mappedBy'BCType'targetEntityBCModele::class, orphanRemovaltrue)]
  20.     private Collection $BCModeles;
  21.     public function __construct()
  22.     {
  23.         $this->BCModeles = 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 getBCFamille(): ?BCFamille
  39.     {
  40.         return $this->BCFamille;
  41.     }
  42.     public function setBCFamille(?BCFamille $BCFamille): self
  43.     {
  44.         $this->BCFamille $BCFamille;
  45.         return $this;
  46.     }
  47.     /**
  48.      * @return Collection<int, BCModele>
  49.      */
  50.     public function getBCModeles(): Collection
  51.     {
  52.         return $this->BCModeles;
  53.     }
  54.     public function addBCModele(BCModele $bCModele): self
  55.     {
  56.         if (!$this->BCModeles->contains($bCModele)) {
  57.             $this->BCModeles->add($bCModele);
  58.             $bCModele->setBCType($this);
  59.         }
  60.         return $this;
  61.     }
  62.     public function removeBCModele(BCModele $bCModele): self
  63.     {
  64.         if ($this->BCModeles->removeElement($bCModele)) {
  65.             // set the owning side to null (unless already changed)
  66.             if ($bCModele->getBCType() === $this) {
  67.                 $bCModele->setBCType(null);
  68.             }
  69.         }
  70.         return $this;
  71.     }
  72. }