<?php
namespace App\Entity;
use App\Repository\FamillesdarticlesRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: FamillesdarticlesRepository::class)]
class Famillesdarticles
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column(length: 255, nullable: true, unique: true)]
private ?string $reference = null;
#[ORM\ManyToOne(inversedBy: 'famillesdarticles')]
private ?Fournisseur $fournisseur = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $prixachat = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $coefficient = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $prixvente = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $qunatity = null;
#[ORM\ManyToOne(inversedBy: 'amillesdarticles')]
private ?Familles $familles = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $tva = null;
#[ORM\ManyToMany(targetEntity: Gestionmachines::class, mappedBy: 'famillesdarticles')]
private Collection $gestionmachines;
#[ORM\Column(length: 255, nullable: true)]
private ?string $unite = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $designation = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $operateur = null;
#[ORM\OneToMany(mappedBy: 'famillesdarticles', targetEntity: Archivearticle::class, cascade: ["remove"])]
private Collection $archivearticle;
#[ORM\ManyToMany(targetEntity: Importdirect::class, mappedBy: 'accarticle')]
private Collection $importdirects;
#[ORM\Column(length: 255, nullable: true)]
private ?string $logo = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $prixttc = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $ngp = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $qtetotal = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $qtenf = null;
#[ORM\OneToMany(mappedBy: 'produit', targetEntity: Articleficheachatnf::class)]
private Collection $articleficheachatnfs;
public function __construct()
{
$this->gestionmachines = new ArrayCollection();
$this->archivearticle = new ArrayCollection();
$this->importdirects = new ArrayCollection();
$this->articleficheachatnfs = new ArrayCollection();
}
public function __toString()
{
return $this->getReference(); // Remplacez "getName()" par la méthode ou la propriété appropriée
}
public function getId(): ?int
{
return $this->id;
}
public function getReference(): ?string
{
return $this->reference;
}
public function setReference(?string $reference): self
{
$this->reference = $reference;
return $this;
}
public function getFournisseur(): ?Fournisseur
{
return $this->fournisseur;
}
public function setFournisseur(?Fournisseur $fournisseur): self
{
$this->fournisseur = $fournisseur;
return $this;
}
public function getPrixachat(): ?string
{
return $this->prixachat;
}
public function setPrixachat(?string $prixachat): self
{
$this->prixachat = $prixachat;
return $this;
}
public function getCoefficient(): ?string
{
return $this->coefficient;
}
public function setCoefficient(?string $coefficient): self
{
$this->coefficient = $coefficient;
return $this;
}
public function getPrixvente(): ?string
{
return $this->prixvente;
}
public function setPrixvente(?string $prixvente): self
{
$this->prixvente = $prixvente;
return $this;
}
public function getQunatity(): ?string
{
return $this->qunatity;
}
public function setQunatity(?string $qunatity): self
{
$this->qunatity = $qunatity;
return $this;
}
public function getFamilles(): ?Familles
{
return $this->familles;
}
public function setFamilles(?Familles $familles): self
{
$this->familles = $familles;
return $this;
}
public function getTva(): ?string
{
return $this->tva;
}
public function setTva(?string $tva): self
{
$this->tva = $tva;
return $this;
}
/**
* @return Collection<int, Gestionmachines>
*/
public function getGestionmachines(): Collection
{
return $this->gestionmachines;
}
public function addGestionmachine(Gestionmachines $gestionmachine): self
{
if (!$this->gestionmachines->contains($gestionmachine)) {
$this->gestionmachines->add($gestionmachine);
$gestionmachine->addFamillesdarticle($this);
}
return $this;
}
public function removeGestionmachine(Gestionmachines $gestionmachine): self
{
if ($this->gestionmachines->removeElement($gestionmachine)) {
$gestionmachine->removeFamillesdarticle($this);
}
return $this;
}
public function getUnite(): ?string
{
return $this->unite;
}
public function setUnite(?string $unite): self
{
$this->unite = $unite;
return $this;
}
public function getDesignation(): ?string
{
return $this->designation;
}
public function setDesignation(?string $designation): static
{
$this->designation = $designation;
return $this;
}
public function getOperateur(): ?string
{
return $this->operateur;
}
public function setOperateur(?string $operateur): static
{
$this->operateur = $operateur;
return $this;
}
/**
* @return Collection<int, Archivearticle>
*/
public function getArchivearticle(): Collection
{
return $this->archivearticle;
}
public function addArchivearticle(Archivearticle $archivearticle): static
{
if (!$this->archivearticle->contains($archivearticle)) {
$this->archivearticle->add($archivearticle);
$archivearticle->setFamillesdarticles($this);
}
return $this;
}
public function removeArchivearticle(Archivearticle $archivearticle): static
{
if ($this->archivearticle->removeElement($archivearticle)) {
// set the owning side to null (unless already changed)
if ($archivearticle->getFamillesdarticles() === $this) {
$archivearticle->setFamillesdarticles(null);
}
}
return $this;
}
/**
* @return Collection<int, Importdirect>
*/
public function getImportdirects(): Collection
{
return $this->importdirects;
}
public function addImportdirect(Importdirect $importdirect): static
{
if (!$this->importdirects->contains($importdirect)) {
$this->importdirects->add($importdirect);
$importdirect->addAccarticle($this);
}
return $this;
}
public function removeImportdirect(Importdirect $importdirect): static
{
if ($this->importdirects->removeElement($importdirect)) {
$importdirect->removeAccarticle($this);
}
return $this;
}
public function getLogo(): ?string
{
return $this->logo;
}
public function setLogo(?string $logo): static
{
$this->logo = $logo;
return $this;
}
public function getPrixttc(): ?string
{
return $this->prixttc;
}
public function setPrixttc(?string $prixttc): static
{
$this->prixttc = $prixttc;
return $this;
}
public function getNgp(): ?string
{
return $this->ngp;
}
public function setNgp(?string $ngp): self
{
$this->ngp = $ngp;
return $this;
}
public function getQtetotal(): ?string
{
return $this->qtetotal;
}
public function setQtetotal(?string $qtetotal): self
{
$this->qtetotal = $qtetotal;
return $this;
}
public function getQtenf(): ?string
{
return $this->qtenf;
}
public function setQtenf(?string $qtenf): self
{
$this->qtenf = $qtenf;
return $this;
}
/**
* @return Collection<int, Articleficheachatnf>
*/
public function getArticleficheachatnfs(): Collection
{
return $this->articleficheachatnfs;
}
public function addArticleficheachatnf(Articleficheachatnf $articleficheachatnf): self
{
if (!$this->articleficheachatnfs->contains($articleficheachatnf)) {
$this->articleficheachatnfs->add($articleficheachatnf);
$articleficheachatnf->setProduit($this);
}
return $this;
}
public function removeArticleficheachatnf(Articleficheachatnf $articleficheachatnf): self
{
if ($this->articleficheachatnfs->removeElement($articleficheachatnf)) {
// set the owning side to null (unless already changed)
if ($articleficheachatnf->getProduit() === $this) {
$articleficheachatnf->setProduit(null);
}
}
return $this;
}
}