<?php
namespace App\Entity;
use App\Repository\BanqueRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: BanqueRepository::class)]
class Banque
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $nombanque = null;
#[ORM\Column(type: Types::TEXT, nullable: true)]
private ?string $banqueinformation = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $adresse = null;
#[ORM\OneToMany(mappedBy: 'banque', targetEntity: Typedepaiement::class, cascade: ["remove"])]
private Collection $typedepaiements;
#[ORM\ManyToMany(targetEntity: Fournisseur::class, mappedBy: 'banque')]
private Collection $fournisseurs;
public function __construct()
{
$this->typedepaiements = new ArrayCollection();
$this->fournisseurs = new ArrayCollection();
}
public function getNom(): ?string
{
return $this->nombanque;
}
public function getId(): ?int
{
return $this->id;
}
public function getNombanque(): ?string
{
return $this->nombanque;
}
public function setNombanque(?string $nombanque): static
{
$this->nombanque = $nombanque;
return $this;
}
public function getBanqueinformation(): ?string
{
return $this->banqueinformation;
}
public function setBanqueinformation(?string $banqueinformation): static
{
$this->banqueinformation = $banqueinformation;
return $this;
}
public function getAdresse(): ?string
{
return $this->adresse;
}
public function setAdresse(?string $adresse): static
{
$this->adresse = $adresse;
return $this;
}
/**
* @return Collection<int, Typedepaiement>
*/
public function getTypedepaiements(): Collection
{
return $this->typedepaiements;
}
public function addTypedepaiement(Typedepaiement $typedepaiement): static
{
if (!$this->typedepaiements->contains($typedepaiement)) {
$this->typedepaiements->add($typedepaiement);
$typedepaiement->setBanque($this);
}
return $this;
}
public function removeTypedepaiement(Typedepaiement $typedepaiement): static
{
if ($this->typedepaiements->removeElement($typedepaiement)) {
// set the owning side to null (unless already changed)
if ($typedepaiement->getBanque() === $this) {
$typedepaiement->setBanque(null);
}
}
return $this;
}
/**
* @return Collection<int, Fournisseur>
*/
public function getFournisseurs(): Collection
{
return $this->fournisseurs;
}
public function addFournisseur(Fournisseur $fournisseur): static
{
if (!$this->fournisseurs->contains($fournisseur)) {
$this->fournisseurs->add($fournisseur);
$fournisseur->addBanque($this);
}
return $this;
}
public function removeFournisseur(Fournisseur $fournisseur): static
{
if ($this->fournisseurs->removeElement($fournisseur)) {
$fournisseur->removeBanque($this);
}
return $this;
}
}