src/Entity/Banque.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\BanqueRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\DBAL\Types\Types;
  7. use Doctrine\ORM\Mapping as ORM;
  8. #[ORM\Entity(repositoryClassBanqueRepository::class)]
  9. class Banque
  10. {
  11.     #[ORM\Id]
  12.     #[ORM\GeneratedValue]
  13.     #[ORM\Column]
  14.     private ?int $id null;
  15.     #[ORM\Column(length255nullabletrue)]
  16.     private ?string $nombanque null;
  17.     #[ORM\Column(typeTypes::TEXTnullabletrue)]
  18.     private ?string $banqueinformation null;
  19.     #[ORM\Column(length255nullabletrue)]
  20.     private ?string $adresse null;
  21.     #[ORM\OneToMany(mappedBy'banque'targetEntityTypedepaiement::class, cascade: ["remove"])]
  22.     private Collection $typedepaiements;
  23.     #[ORM\ManyToMany(targetEntityFournisseur::class, mappedBy'banque')]
  24.     private Collection $fournisseurs;
  25.     public function __construct()
  26.     {
  27.         $this->typedepaiements = new ArrayCollection();
  28.         $this->fournisseurs = new ArrayCollection();
  29.     }
  30.     public function getNom(): ?string
  31.     {
  32.         return $this->nombanque;
  33.     }
  34.     public function getId(): ?int
  35.     {
  36.         return $this->id;
  37.     }
  38.     public function getNombanque(): ?string
  39.     {
  40.         return $this->nombanque;
  41.     }
  42.     public function setNombanque(?string $nombanque): static
  43.     {
  44.         $this->nombanque $nombanque;
  45.         return $this;
  46.     }
  47.     public function getBanqueinformation(): ?string
  48.     {
  49.         return $this->banqueinformation;
  50.     }
  51.     public function setBanqueinformation(?string $banqueinformation): static
  52.     {
  53.         $this->banqueinformation $banqueinformation;
  54.         return $this;
  55.     }
  56.     public function getAdresse(): ?string
  57.     {
  58.         return $this->adresse;
  59.     }
  60.     public function setAdresse(?string $adresse): static
  61.     {
  62.         $this->adresse $adresse;
  63.         return $this;
  64.     }
  65.     /**
  66.      * @return Collection<int, Typedepaiement>
  67.      */
  68.     public function getTypedepaiements(): Collection
  69.     {
  70.         return $this->typedepaiements;
  71.     }
  72.     public function addTypedepaiement(Typedepaiement $typedepaiement): static
  73.     {
  74.         if (!$this->typedepaiements->contains($typedepaiement)) {
  75.             $this->typedepaiements->add($typedepaiement);
  76.             $typedepaiement->setBanque($this);
  77.         }
  78.         return $this;
  79.     }
  80.     public function removeTypedepaiement(Typedepaiement $typedepaiement): static
  81.     {
  82.         if ($this->typedepaiements->removeElement($typedepaiement)) {
  83.             // set the owning side to null (unless already changed)
  84.             if ($typedepaiement->getBanque() === $this) {
  85.                 $typedepaiement->setBanque(null);
  86.             }
  87.         }
  88.         return $this;
  89.     }
  90.     /**
  91.      * @return Collection<int, Fournisseur>
  92.      */
  93.     public function getFournisseurs(): Collection
  94.     {
  95.         return $this->fournisseurs;
  96.     }
  97.     public function addFournisseur(Fournisseur $fournisseur): static
  98.     {
  99.         if (!$this->fournisseurs->contains($fournisseur)) {
  100.             $this->fournisseurs->add($fournisseur);
  101.             $fournisseur->addBanque($this);
  102.         }
  103.         return $this;
  104.     }
  105.     public function removeFournisseur(Fournisseur $fournisseur): static
  106.     {
  107.         if ($this->fournisseurs->removeElement($fournisseur)) {
  108.             $fournisseur->removeBanque($this);
  109.         }
  110.         return $this;
  111.     }
  112. }