<?php
namespace App\Entity;
use App\Repository\DerogationRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: DerogationRepository::class)]
class Derogation implements \Stringable
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column(type: 'integer')]
private $id;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $reference;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $coloris;
#[ORM\ManyToOne(targetEntity: Taille::class, inversedBy: 'derogations')]
private $taille;
#[ORM\ManyToOne(targetEntity: Bonnet::class, inversedBy: 'derogations')]
private $bonnet;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $numero_lancement;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $name_derogation;
#[ORM\Column(type: 'float', nullable: true)]
private $quantite_carton;
#[ORM\Column(type: 'float', nullable: true)]
private $quantite_derogation;
#[ORM\Column(type: 'datetime', nullable: true)]
private $date_demande;
#[ORM\ManyToOne(targetEntity: Defaut::class, inversedBy: 'derogations')]
private $defaut;
#[ORM\ManyToOne(targetEntity: TableauMesureLibelle::class, inversedBy: 'derogations')]
private $mesure;
#[ORM\ManyToOne(targetEntity: Atelier::class, inversedBy: 'derogations')]
private $atelier;
#[ORM\OneToMany(targetEntity: FicheQualite::class, mappedBy: 'derogation', cascade: ['persist', 'remove'])]
private $ficheQualites;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $numero_derogation;
public function __construct()
{
$this->ficheQualites = new ArrayCollection();
}
public function __toString(): string
{
return (string) $this->name_derogation;
}
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 getColoris(): ?string
{
return $this->coloris;
}
public function setColoris(?string $coloris): self
{
$this->coloris = $coloris;
return $this;
}
public function getTaille(): ?Taille
{
return $this->taille;
}
public function setTaille(?Taille $taille): self
{
$this->taille = $taille;
return $this;
}
public function getBonnet(): ?Bonnet
{
return $this->bonnet;
}
public function setBonnet(?Bonnet $bonnet): self
{
$this->bonnet = $bonnet;
return $this;
}
public function getNumeroLancement(): ?string
{
return $this->numero_lancement;
}
public function setNumeroLancement(?string $numero_lancement): self
{
$this->numero_lancement = $numero_lancement;
return $this;
}
public function getNameDerogation(): ?string
{
return $this->name_derogation;
}
public function setNameDerogation(?string $name_derogation): self
{
$this->name_derogation = $name_derogation;
return $this;
}
public function getQuantiteCarton(): ?float
{
return $this->quantite_carton;
}
public function setQuantiteCarton(?float $quantite_carton): self
{
$this->quantite_carton = $quantite_carton;
return $this;
}
public function getQuantiteDerogation(): ?float
{
return $this->quantite_derogation;
}
public function setQuantiteDerogation(?float $quantite_derogation): self
{
$this->quantite_derogation = $quantite_derogation;
return $this;
}
public function getDateDemande(): ?\DateTimeInterface
{
return $this->date_demande;
}
public function setDateDemande(?\DateTimeInterface $date_demande): self
{
$this->date_demande = $date_demande;
return $this;
}
public function getDefaut(): ?Defaut
{
return $this->defaut;
}
public function setDefaut(?Defaut $defaut): self
{
$this->defaut = $defaut;
return $this;
}
public function getMesure(): ?TableauMesureLibelle
{
return $this->mesure;
}
public function setMesure(?TableauMesureLibelle $mesure): self
{
$this->mesure = $mesure;
return $this;
}
public function getAtelier(): ?Atelier
{
return $this->atelier;
}
public function setAtelier(?Atelier $atelier): self
{
$this->atelier = $atelier;
return $this;
}
/**
* @return Collection<int, FicheQualite>
*/
public function getFicheQualites(): Collection
{
return $this->ficheQualites;
}
public function addFicheQualite(FicheQualite $ficheQualite): self
{
if (!$this->ficheQualites->contains($ficheQualite)) {
$this->ficheQualites[] = $ficheQualite;
$ficheQualite->setDerogation($this);
}
return $this;
}
public function removeFicheQualite(FicheQualite $ficheQualite): self
{
if ($this->ficheQualites->removeElement($ficheQualite)) {
// set the owning side to null (unless already changed)
if ($ficheQualite->getDerogation() === $this) {
$ficheQualite->setDerogation(null);
}
}
return $this;
}
public function getNumeroDerogation(): ?string
{
return $this->numero_derogation;
}
public function setNumeroDerogation(?string $numero_derogation): self
{
$this->numero_derogation = $numero_derogation;
return $this;
}
}