<?php
namespace App\Entity;
use App\Repository\GestionmachinesRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: GestionmachinesRepository::class)]
class Gestionmachines
{
#[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 $numserie = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $nbchute = null;
#[ORM\ManyToMany(targetEntity: Aiguilles::class, inversedBy: 'gestionmachines')]
private Collection $aiguilles;
#[ORM\ManyToMany(targetEntity: Courroie::class, inversedBy: 'gestionmachines')]
private Collection $courroie;
#[ORM\ManyToMany(targetEntity: Platines::class, inversedBy: 'gestionmachines')]
private Collection $platines;
#[ORM\ManyToOne(inversedBy: 'gestionmachines')]
private ?Machine $machine = null;
#[ORM\ManyToOne(inversedBy: 'gestionmachines')]
private ?ModeleMachine $modeleMachine = null;
#[ORM\ManyToOne(inversedBy: 'gestionmachines')]
private ?JaugeMachine $jaugeMachine = null;
#[ORM\ManyToOne(inversedBy: 'gestionmachines')]
private ?DiametreMachine $diametreMachine = null;
#[ORM\ManyToOne(inversedBy: 'gestionmachines')]
private ?Nbchute $nbchutee = null;
#[ORM\ManyToOne(inversedBy: 'gestionmachines')]
private ?MarqueMachine $marqueMachine = null;
#[ORM\ManyToOne(inversedBy: 'gestionmachines')]
private ?Client $client = null;
#[ORM\ManyToMany(targetEntity: Famillesdarticles::class, inversedBy: 'gestionmachines')]
private Collection $famillesdarticles;
#[ORM\ManyToOne(inversedBy: 'gestionmachines')]
private ?Structure $structure = null;
#[ORM\OneToMany(mappedBy: 'nummachine', targetEntity: Intervention::class, cascade: ["remove"])]
private Collection $interventions;
#[ORM\OneToMany(mappedBy: 'nummachine', targetEntity: Historiqueintervention::class, cascade: ["remove"])]
private Collection $historiqueinterventions;
#[ORM\Column(length: 255, nullable: true)]
private ?string $num = null;
#[ORM\OneToMany(mappedBy: 'machine', targetEntity: MachineIntervention::class)]
private Collection $machineInterventions;
public function __construct()
{
$this->aiguilles = new ArrayCollection();
$this->courroie = new ArrayCollection();
$this->platines = new ArrayCollection();
$this->famillesdarticles = new ArrayCollection();
$this->interventions = new ArrayCollection();
$this->historiqueinterventions = new ArrayCollection();
$this->machineInterventions = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getNom(): ?string
{
return $this->nom;
}
public function setNom(?string $nom): self
{
$this->nom = $nom;
return $this;
}
public function getNumserie(): ?string
{
return $this->numserie;
}
public function setNumserie(?string $numserie): self
{
$this->numserie = $numserie;
return $this;
}
public function getNbchute(): ?string
{
return $this->nbchute;
}
public function setNbchute(?string $nbchute): self
{
$this->nbchute = $nbchute;
return $this;
}
/**
* @return Collection<int, Aiguilles>
*/
public function getAiguilles(): Collection
{
return $this->aiguilles;
}
public function addAiguille(Aiguilles $aiguille): self
{
if (!$this->aiguilles->contains($aiguille)) {
$this->aiguilles->add($aiguille);
}
return $this;
}
public function removeAiguille(Aiguilles $aiguille): self
{
$this->aiguilles->removeElement($aiguille);
return $this;
}
/**
* @return Collection<int, Courroie>
*/
public function getCourroie(): Collection
{
return $this->courroie;
}
public function addCourroie(Courroie $courroie): self
{
if (!$this->courroie->contains($courroie)) {
$this->courroie->add($courroie);
}
return $this;
}
public function removeCourroie(Courroie $courroie): self
{
$this->courroie->removeElement($courroie);
return $this;
}
/**
* @return Collection<int, Platines>
*/
public function getPlatines(): Collection
{
return $this->platines;
}
public function addPlatine(Platines $platine): self
{
if (!$this->platines->contains($platine)) {
$this->platines->add($platine);
}
return $this;
}
public function removePlatine(Platines $platine): self
{
$this->platines->removeElement($platine);
return $this;
}
public function getMachine(): ?Machine
{
return $this->machine;
}
public function setMachine(?Machine $machine): self
{
$this->machine = $machine;
return $this;
}
public function getModeleMachine(): ?ModeleMachine
{
return $this->modeleMachine;
}
public function setModeleMachine(?ModeleMachine $modeleMachine): self
{
$this->modeleMachine = $modeleMachine;
return $this;
}
public function getJaugeMachine(): ?JaugeMachine
{
return $this->jaugeMachine;
}
public function setJaugeMachine(?JaugeMachine $jaugeMachine): self
{
$this->jaugeMachine = $jaugeMachine;
return $this;
}
public function getDiametreMachine(): ?DiametreMachine
{
return $this->diametreMachine;
}
public function setDiametreMachine(?DiametreMachine $diametreMachine): self
{
$this->diametreMachine = $diametreMachine;
return $this;
}
public function getNbchutee(): ?Nbchute
{
return $this->nbchutee;
}
public function setNbchutee(?Nbchute $nbchutee): self
{
$this->nbchutee = $nbchutee;
return $this;
}
public function getMarqueMachine(): ?MarqueMachine
{
return $this->marqueMachine;
}
public function setMarqueMachine(?MarqueMachine $marqueMachine): self
{
$this->marqueMachine = $marqueMachine;
return $this;
}
public function getClient(): ?Client
{
return $this->client;
}
public function setClient(?Client $client): self
{
$this->client = $client;
return $this;
}
/**
* @return Collection<int, Famillesdarticles>
*/
public function getFamillesdarticles(): Collection
{
return $this->famillesdarticles;
}
public function addFamillesdarticle(Famillesdarticles $famillesdarticle): self
{
if (!$this->famillesdarticles->contains($famillesdarticle)) {
$this->famillesdarticles->add($famillesdarticle);
}
return $this;
}
public function removeFamillesdarticle(Famillesdarticles $famillesdarticle): self
{
$this->famillesdarticles->removeElement($famillesdarticle);
return $this;
}
/**
* @return Collection<int, Structure>
*/
public function getStructure(): ?Structure
{
return $this->structure;
}
public function setStructure(?Structure $structure): self
{
$this->structure = $structure;
return $this;
}
/**
* @return Collection<int, Intervention>
*/
public function getInterventions(): Collection
{
return $this->interventions;
}
public function addIntervention(Intervention $intervention): static
{
if (!$this->interventions->contains($intervention)) {
$this->interventions->add($intervention);
$intervention->setNummachine($this);
}
return $this;
}
public function removeIntervention(Intervention $intervention): static
{
if ($this->interventions->removeElement($intervention)) {
// set the owning side to null (unless already changed)
if ($intervention->getNummachine() === $this) {
$intervention->setNummachine(null);
}
}
return $this;
}
/**
* @return Collection<int, Historiqueintervention>
*/
public function getHistoriqueinterventions(): Collection
{
return $this->historiqueinterventions;
}
public function addHistoriqueintervention(Historiqueintervention $historiqueintervention): static
{
if (!$this->historiqueinterventions->contains($historiqueintervention)) {
$this->historiqueinterventions->add($historiqueintervention);
$historiqueintervention->setNummachine($this);
}
return $this;
}
public function removeHistoriqueintervention(Historiqueintervention $historiqueintervention): static
{
if ($this->historiqueinterventions->removeElement($historiqueintervention)) {
// set the owning side to null (unless already changed)
if ($historiqueintervention->getNummachine() === $this) {
$historiqueintervention->setNummachine(null);
}
}
return $this;
}
public function getNum(): ?string
{
return $this->num;
}
public function setNum(?string $num): self
{
$this->num = $num;
return $this;
}
/**
* @return Collection<int, MachineIntervention>
*/
public function getMachineInterventions(): Collection
{
return $this->machineInterventions;
}
public function addMachineIntervention(MachineIntervention $machineIntervention): self
{
if (!$this->machineInterventions->contains($machineIntervention)) {
$this->machineInterventions->add($machineIntervention);
$machineIntervention->setMachine($this);
}
return $this;
}
public function removeMachineIntervention(MachineIntervention $machineIntervention): self
{
if ($this->machineInterventions->removeElement($machineIntervention)) {
// set the owning side to null (unless already changed)
if ($machineIntervention->getMachine() === $this) {
$machineIntervention->setMachine(null);
}
}
return $this;
}
}