<?php
namespace App\Entity;
use App\Repository\FournisseurRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: FournisseurRepository::class)]
class Fournisseur
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $nom = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $prenom = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $adresse = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $telephone = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $numcomptebancaire = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $mf = null;
#[ORM\Column(type: Types::DATETIME_MUTABLE, nullable: true)]
private ?\DateTimeInterface $date = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $typefournisseur = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $email = null;
#[ORM\OneToMany(targetEntity: Produits::class, mappedBy: 'fournisseur', cascade: ["remove", "persist"])]
private Collection $produits;
#[ORM\OneToMany(targetEntity: Ficheachat::class, mappedBy: 'fournisseur', cascade: ["remove", "persist"])]
private Collection $ficheachats;
#[ORM\Column(nullable: true)]
private ?bool $IsArchive = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $societe = null;
#[ORM\OneToMany(targetEntity: Ficheachatcomptable::class, mappedBy: 'fournisseur')]
private Collection $ficheachatcomptables;
public function __construct()
{
$this->produits = new ArrayCollection();
$this->ficheachats = new ArrayCollection();
$this->ficheachatcomptables = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getNom(): ?string
{
return $this->nom;
}
public function setNom(?string $nom): static
{
$this->nom = $nom;
return $this;
}
public function getPrenom(): ?string
{
return $this->prenom;
}
public function setPrenom(?string $prenom): static
{
$this->prenom = $prenom;
return $this;
}
public function getAdresse(): ?string
{
return $this->adresse;
}
public function setAdresse(?string $adresse): static
{
$this->adresse = $adresse;
return $this;
}
public function getTelephone(): ?string
{
return $this->telephone;
}
public function setTelephone(?string $telephone): static
{
$this->telephone = $telephone;
return $this;
}
public function getNumcomptebancaire(): ?string
{
return $this->numcomptebancaire;
}
public function setNumcomptebancaire(?string $numcomptebancaire): static
{
$this->numcomptebancaire = $numcomptebancaire;
return $this;
}
public function getMf(): ?string
{
return $this->mf;
}
public function setMf(?string $mf): static
{
$this->mf = $mf;
return $this;
}
public function getDate(): ?\DateTimeInterface
{
return $this->date;
}
public function setDate(?\DateTimeInterface $date): static
{
$this->date = $date;
return $this;
}
public function getTypefournisseur(): ?string
{
return $this->typefournisseur;
}
public function setTypefournisseur(?string $typefournisseur): static
{
$this->typefournisseur = $typefournisseur;
return $this;
}
public function getEmail(): ?string
{
return $this->email;
}
public function setEmail(?string $email): static
{
$this->email = $email;
return $this;
}
/**
* @return Collection<int, Produits>
*/
public function getProduits(): Collection
{
return $this->produits;
}
public function addProduit(Produits $produit): static
{
if (!$this->produits->contains($produit)) {
$this->produits->add($produit);
$produit->setFournisseur($this);
}
return $this;
}
public function removeProduit(Produits $produit): static
{
if ($this->produits->removeElement($produit)) {
// set the owning side to null (unless already changed)
if ($produit->getFournisseur() === $this) {
$produit->setFournisseur(null);
}
}
return $this;
}
/**
* @return Collection<int, Ficheachat>
*/
public function getFicheachats(): Collection
{
return $this->ficheachats;
}
public function addFicheachat(Ficheachat $ficheachat): static
{
if (!$this->ficheachats->contains($ficheachat)) {
$this->ficheachats->add($ficheachat);
$ficheachat->setFournisseur($this);
}
return $this;
}
public function removeFicheachat(Ficheachat $ficheachat): static
{
if ($this->ficheachats->removeElement($ficheachat)) {
// set the owning side to null (unless already changed)
if ($ficheachat->getFournisseur() === $this) {
$ficheachat->setFournisseur(null);
}
}
return $this;
}
public function isIsArchive(): ?bool
{
return $this->IsArchive;
}
public function setIsArchive(?bool $IsArchive): static
{
$this->IsArchive = $IsArchive;
return $this;
}
public function getSociete(): ?string
{
return $this->societe;
}
public function setSociete(?string $societe): static
{
$this->societe = $societe;
return $this;
}
/**
* @return Collection<int, Ficheachatcomptable>
*/
public function getFicheachatcomptables(): Collection
{
return $this->ficheachatcomptables;
}
public function addFicheachatcomptable(Ficheachatcomptable $ficheachatcomptable): static
{
if (!$this->ficheachatcomptables->contains($ficheachatcomptable)) {
$this->ficheachatcomptables->add($ficheachatcomptable);
$ficheachatcomptable->setFournisseur($this);
}
return $this;
}
public function removeFicheachatcomptable(Ficheachatcomptable $ficheachatcomptable): static
{
if ($this->ficheachatcomptables->removeElement($ficheachatcomptable)) {
// set the owning side to null (unless already changed)
if ($ficheachatcomptable->getFournisseur() === $this) {
$ficheachatcomptable->setFournisseur(null);
}
}
return $this;
}
}