src/Entity/User.php line 25

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\Common\Collections\ArrayCollection;
  4. use Doctrine\Common\Collections\Collection;
  5. use Doctrine\ORM\Mapping as ORM;
  6. use App\Entity\Attachement;
  7. use App\Entity\Attribution;
  8. use App\Entity\Commande;
  9. use App\Entity\CommandeFournisseur;
  10. use App\Entity\CommandePrestataire;
  11. use App\Entity\Devis;
  12. use App\Entity\Facture;
  13. use App\Entity\FactureFournisseur;
  14. use App\Entity\FacturePrestataire;
  15. use Symfony\Component\Security\Core\User\UserInterface;
  16. /**
  17.  * User
  18.  *
  19.  * @ORM\Table(name="users")
  20.  * @ORM\Entity(repositoryClass="App\Repository\UserRepository")
  21.  */
  22. class User implements UserInterface
  23. {
  24.     /**
  25.      * @ORM\Id()
  26.      * @ORM\GeneratedValue()
  27.      * @ORM\Column(type="integer")
  28.      */
  29.     private $id;
  30.     /**
  31.      * @var string
  32.      *
  33.      * @ORM\Column(name="username", type="string", length=75, unique=true, nullable=true)
  34.      */
  35.     private $username;
  36.     /**
  37.      * @var string
  38.      *
  39.      * @ORM\Column(name="nom", type="string", length=75)
  40.      */
  41.     private $nom;
  42.     /**
  43.      * @var string
  44.      *
  45.      * @ORM\Column(name="prenom", type="string", length=75)
  46.      */
  47.     private $prenom;
  48.     /**
  49.      * @var string
  50.      *
  51.      * @ORM\Column(name="email", type="string", length=75, unique=true)
  52.      */
  53.     private $email;
  54.     /**
  55.      * @var string
  56.      *
  57.      * @ORM\Column(name="password", type="string", length=255, nullable=true)
  58.      */
  59.     protected $password;
  60.     /**
  61.      * @ORM\Column(type="string", length=255, nullable=true)
  62.      */
  63.     private $telephone;
  64.     /**
  65.      * @ORM\Column(type="string", length=255, nullable=true, unique=true)
  66.      */
  67.     private $mobile;
  68.     /**
  69.      * @ORM\Column(name="roles", type="array")
  70.      */
  71.     private $roles = array();
  72.     /**
  73.      * @var bool
  74.      *
  75.      * @ORM\Column(name="isActive", type="boolean")
  76.      */
  77.     private $isActive;
  78.     /**
  79.      * @var string
  80.      * @ORM\Column(name="token", type="string", length=64, nullable=true)
  81.      */
  82.     private $token;
  83.     /**
  84.      * @var date
  85.      * @ORM\Column(name="validity", type="datetime")
  86.      */
  87.     private $validity;
  88.     /**
  89.      * @var float
  90.      * @ORM\Column(name="portefeuille", type="float", nullable=true)
  91.      */
  92.     private $portefeuille;
  93.     /**
  94.      * @ORM\ManyToOne(targetEntity="App\Entity\UserEntity")
  95.      * @ORM\JoinColumn(nullable=false)
  96.      */
  97.     private $userEntity;
  98.     /**
  99.      * @var Attribution[]
  100.      * @ORM\OneToMany(targetEntity="App\Entity\Attribution", mappedBy="user")
  101.      */
  102.     private $attributions;
  103.     /**
  104.      * @ORM\OneToMany(targetEntity="App\Entity\Commande", mappedBy="user")
  105.      */
  106.     private $commandes;
  107.     /**
  108.      * @ORM\OneToMany(targetEntity="App\Entity\CommandeFournisseur", mappedBy="user")
  109.      */
  110.     private $commandeFournisseur;
  111.     /**
  112.      * @ORM\OneToMany(targetEntity="App\Entity\CommandePrestataire", mappedBy="user")
  113.      */
  114.     private $commandePrestataire;
  115.     /**
  116.      * @ORM\OneToMany(targetEntity="App\Entity\FactureFournisseur", mappedBy="user")
  117.      */
  118.     private $factureFournisseur;
  119.     /**
  120.      * @ORM\OneToMany(targetEntity="App\Entity\FacturePrestataire", mappedBy="user")
  121.      */
  122.     private $facturePrestataire;
  123.     /**
  124.      * @ORM\OneToMany(targetEntity="App\Entity\Devis", mappedBy="user")
  125.      */
  126.     private $devis;
  127.     /**
  128.      * @ORM\OneToMany(targetEntity="App\Entity\Attachement", mappedBy="user")
  129.      */
  130.     private $attachements;
  131.     /**
  132.      * @ORM\OneToMany(targetEntity="App\Entity\Facture", mappedBy="user")
  133.      */
  134.     private $factures;
  135.     /**
  136.      * @ORM\OneToMany(targetEntity="App\Entity\Organisme", mappedBy="user")
  137.      */
  138.     private $organismes;
  139.     /**
  140.      * @ORM\OneToMany(targetEntity="App\Entity\Contact", mappedBy="user")
  141.      */
  142.     private $contacts;
  143.     /**
  144.      * @ORM\OneToMany(targetEntity=DataView::class, mappedBy="owner", orphanRemoval=true)
  145.      * @ORM\OrderBy({"id" = "ASC"})
  146.      */
  147.     private $dataViews;
  148.     /**
  149.      * @ORM\ManyToOne(targetEntity=Entite::class, inversedBy="users")
  150.      */
  151.     private $entite;
  152.     /**
  153.      * @ORM\OneToMany(targetEntity=UserArticle::class, mappedBy="user")
  154.      */
  155.     private $userArticles;
  156.     /**
  157.      * @ORM\OneToMany(targetEntity=AvancementCommande::class, mappedBy="editor")
  158.      */
  159.     private $avancementCommandes;
  160.     /**
  161.      * @ORM\OneToMany(targetEntity=AvancementCommandeFournisseur::class, mappedBy="editor")
  162.      */
  163.     private $avancementCommandeFournisseurs;
  164.     /**
  165.      * @ORM\OneToMany(targetEntity=Parametre::class, mappedBy="owner")
  166.      */
  167.     private $parametres;
  168.     /**
  169.      * @ORM\Column(type="bigint", nullable=true)
  170.      */
  171.     private $lastConnexionAt;
  172.     public function getRolesForm($role)
  173.     {
  174.         if ($role[0] == 'ROLE_SUPER_SUDALYS') {
  175.             $roles = [
  176.                      'Administrateur' => 'ROLE_ADMIN',
  177.                      'Utilisateur Sudalys' => 'ROLE_SUDALYS',
  178.                      'Super Admin Sudalys' => 'ROLE_SUPER_SUDALYS',
  179.                      'Administrif Sudalys' => 'ROLE_SUDALYS_ADMINISTRATIF'
  180.             ];
  181.         } elseif ($role[0] == 'ROLE_SUDALYS_ADMINISTRATIF') {
  182.             $roles = [
  183.                     'Administrateur' => 'ROLE_ADMIN',
  184.                     'Utilisateur Sudalys' => 'ROLE_SUDALYS',
  185.                     'Administrif Sudalys' => 'ROLE_SUDALYS_ADMINISTRATIF'];
  186.         } elseif ($role[0] == 'ROLE_SUDALYS') {
  187.             $roles = [
  188.                 'Utilisateur Sudalys' => 'ROLE_SUDALYS'
  189.             ];
  190.         }
  191.         return $roles;
  192.     }
  193.     public function __construct()
  194.     {
  195.         $this->isActive true;
  196.         $this->attributions = new ArrayCollection();
  197.         $this->commandes = new ArrayCollection();
  198.         $this->commandeFournisseur = new ArrayCollection();
  199.         $this->commandePrestataire= new ArrayCollection();
  200.         $this->factureFournisseur = new ArrayCollection();
  201.         $this->facturePrestataire = new ArrayCollection();
  202.         $this->devis = new ArrayCollection();
  203.         $this->attachements = new ArrayCollection();
  204.         $this->factures = new ArrayCollection();
  205.         $this->organismes = new ArrayCollection();
  206.         $this->contacts = new ArrayCollection();
  207.         $this->dataViews = new ArrayCollection();
  208.         $this->userArticles = new ArrayCollection();
  209.         $this->avancementCommandes = new ArrayCollection();
  210.         $this->avancementCommandeFournisseurs = new ArrayCollection();
  211.         $this->parametres = new ArrayCollection();
  212.     }
  213.     public function __toString()
  214.     {
  215.         return $this->prenom " " $this->nom;
  216.     }
  217.     public function getAffaires()
  218.     {
  219.         $affaires = [];
  220.         $attributions $this->getAttributions();
  221.         foreach ($attributions as $attribution) {
  222.             if ($attribution->getAffaire()->getArchivedAt() === null) {
  223.                 array_push($affaires$attribution->getAffaire());
  224.             }
  225.         }
  226.         return $affaires;
  227.     }
  228.     /**
  229.      * Get id
  230.      *
  231.      * @return int
  232.      */
  233.     public function getId()
  234.     {
  235.         return $this->id;
  236.     }
  237.     /**
  238.      * Set username
  239.      *
  240.      * @param string $username
  241.      *
  242.      * @return User
  243.      */
  244.     public function setUsername($username)
  245.     {
  246.         $this->username $username;
  247.         return $this;
  248.     }
  249.     /**
  250.      * Get username
  251.      *
  252.      * @return string
  253.      */
  254.     public function getUsername()
  255.     {
  256.         return $this->username;
  257.     }
  258.     /**
  259.      * Set password
  260.      *
  261.      * @param string $password
  262.      *
  263.      * @return User
  264.      */
  265.     public function setPassword($password)
  266.     {
  267.         $this->password $password;
  268.         return $this;
  269.     }
  270.     public function getTelephone()
  271.     {
  272.         return $this->telephone;
  273.     }
  274.     public function setTelephone($telephone)
  275.     {
  276.         $this->telephone $telephone;
  277.         return $this;
  278.     }
  279.     public function getMobile()
  280.     {
  281.         return $this->mobile;
  282.     }
  283.     public function setMobile($mobile)
  284.     {
  285.         $this->mobile $mobile;
  286.         return $this;
  287.     }
  288.     /**
  289.      * Get password
  290.      *
  291.      * @return string
  292.      */
  293.     public function getPassword()
  294.     {
  295.         return $this->password;
  296.     }
  297.     /**
  298.      * Set email
  299.      *
  300.      * @param string $email
  301.      *
  302.      * @return User
  303.      */
  304.     public function setEmail($email)
  305.     {
  306.         $this->email $email;
  307.         return $this;
  308.     }
  309.     /**
  310.      * Get email
  311.      *
  312.      * @return string
  313.      */
  314.     public function getEmail()
  315.     {
  316.         return $this->email;
  317.     }
  318.     /**
  319.      * Set isActive
  320.      *
  321.      * @param boolean $isActive
  322.      *
  323.      * @return User
  324.      */
  325.     public function setIsActive($isActive)
  326.     {
  327.         $this->isActive $isActive;
  328.         return $this;
  329.     }
  330.     /**
  331.      * Get isActive
  332.      *
  333.      * @return bool
  334.      */
  335.     public function getIsActive()
  336.     {
  337.         return $this->isActive;
  338.     }
  339.     public function getSalt()
  340.     {
  341.         // you *may* need a real salt depending on your encoder
  342.         // see section on salt below
  343.         return null;
  344.     }
  345.     public function eraseCredentials()
  346.     {
  347.         $this->plainPassword null;
  348.     }
  349.     public function getRoles()
  350.     {
  351.         return $this->roles;
  352.     }
  353.     /**
  354.      * Set roles
  355.      *
  356.      * @param array $roles
  357.      *
  358.      * @return User
  359.      */
  360.     public function setRoles($roles)
  361.     {
  362.         $this->roles $roles;
  363.         return $this;
  364.     }
  365.     /**
  366.      * Set nom
  367.      *
  368.      * @param string $nom
  369.      *
  370.      * @return User
  371.      */
  372.     public function setNom($nom)
  373.     {
  374.         $this->nom $nom;
  375.         return $this;
  376.     }
  377.     /**
  378.      * Get nom
  379.      *
  380.      * @return string
  381.      */
  382.     public function getNom()
  383.     {
  384.         return $this->nom;
  385.     }
  386.     /**
  387.      * Set prenom
  388.      *
  389.      * @param string $prenom
  390.      *
  391.      * @return User
  392.      */
  393.     public function setPrenom($prenom)
  394.     {
  395.         $this->prenom $prenom;
  396.         return $this;
  397.     }
  398.     /**
  399.      * Get prenom
  400.      *
  401.      * @return string
  402.      */
  403.     public function getPrenom()
  404.     {
  405.         return $this->prenom;
  406.     }
  407.     /**
  408.      * Set userEntity
  409.      *
  410.      * @param UserEntity $userEntity
  411.      *
  412.      * @return User
  413.      */
  414.     public function setUserEntity($userEntity)
  415.     {
  416.         $this->userEntity $userEntity;
  417.         return $this;
  418.     }
  419.     /**
  420.      * Get userEntity
  421.      *
  422.      * @return UserEntity
  423.      */
  424.     public function getUserEntity()
  425.     {
  426.         return $this->userEntity;
  427.     }
  428.     /**
  429.      * Set token
  430.      *
  431.      * @param string $token
  432.      *
  433.      * @return User
  434.      */
  435.     public function setToken($token)
  436.     {
  437.         $this->token $token;
  438.         return $this;
  439.     }
  440.     /**
  441.      * Get token
  442.      *
  443.      * @return string
  444.      */
  445.     public function getToken()
  446.     {
  447.         return $this->token;
  448.     }
  449.     /**
  450.      * Set validity
  451.      *
  452.      * @param \DateTime $validity
  453.      *
  454.      * @return User
  455.      */
  456.     public function setValidity($validity)
  457.     {
  458.         $this->validity $validity;
  459.         return $this;
  460.     }
  461.     /**
  462.      * Get validity
  463.      *
  464.      * @return \DateTime
  465.      */
  466.     public function getValidity()
  467.     {
  468.         return $this->validity;
  469.     }
  470.     /**
  471.      * Set portefeuille
  472.      *
  473.      * @param float $portefeuille
  474.      *
  475.      * @return User
  476.      */
  477.     public function setPortefeuille($portefeuille)
  478.     {
  479.         $this->portefeuille $portefeuille;
  480.         return $this;
  481.     }
  482.     /**
  483.      * Get portefeuille
  484.      *
  485.      * @return float
  486.      */
  487.     public function getPortefeuille()
  488.     {
  489.         return $this->portefeuille;
  490.     }
  491.     /**
  492.      * @return Collection|Attribution[]
  493.      */
  494.     public function getAttributions()
  495.     {
  496.         return $this->attributions;
  497.     }
  498.     public function addAttributions(Attribution $attribution)
  499.     {
  500.         if (!$this->attributions->contains($attribution)) {
  501.             $this->attributions[] = $attribution;
  502.             $attribution->setUser($this);
  503.         }
  504.         return $this;
  505.     }
  506.     public function removeAttributions(Attribution $attribution)
  507.     {
  508.         if ($this->attributions->contains($attribution)) {
  509.             $this->attributions->removeElement($attribution);
  510.             // set the owning side to null (unless already changed)
  511.             if ($attribution->getUser() === $this) {
  512.                 $attribution->setUser(null);
  513.             }
  514.         }
  515.         return $this;
  516.     }
  517.     /**
  518.      * @return Collection|Commande[]
  519.      */
  520.     public function getCommandes()
  521.     {
  522.         return $this->commandes;
  523.     }
  524.     public function addCommande(Commande $commande)
  525.     {
  526.         if (!$this->commandes->contains($commande)) {
  527.             $this->commandes[] = $commande;
  528.             $commande->setUser($this);
  529.         }
  530.         return $this;
  531.     }
  532.     public function removeCommande(Commande $commande)
  533.     {
  534.         if ($this->commandes->contains($commande)) {
  535.             $this->commandes->removeElement($commande);
  536.             // set the owning side to null (unless already changed)
  537.             if ($commande->getUser() === $this) {
  538.                 $commande->setUser(null);
  539.             }
  540.         }
  541.         return $this;
  542.     }
  543.     /**
  544.      * @return Collection|CommandeFournisseur[]
  545.      */
  546.     public function getCommandeFournisseur()
  547.     {
  548.         return $this->commandeFournisseurs;
  549.     }
  550.     public function addCommandeFournisseur(CommandeFournisseur $commandeFournisseur)
  551.     {
  552.         if (!$this->commandeFournisseur->contains($commandeFournisseur)) {
  553.             $this->commandeFournisseur[] = $commandeFournisseur;
  554.             $commandeFournisseur->setUser($this);
  555.         }
  556.         return $this;
  557.     }
  558.     public function removeCommandeFournisseur(CommandeFournisseur $commandeFournisseur)
  559.     {
  560.         if ($this->commandeFournisseur->contains($commandeFournisseur)) {
  561.             $this->commandeFournisseur->removeElement($commandeFournisseur);
  562.             // set the owning side to null (unless already changed)
  563.             if ($commandeFournisseur->getUser() === $this) {
  564.                 $commandeFournisseur->setUser(null);
  565.             }
  566.         }
  567.         return $this;
  568.     }
  569.     /**
  570.      * @return Collection|CommandePrestataire[]
  571.      */
  572.     public function getCommandePrestataire()
  573.     {
  574.         return $this->commandePrestataire;
  575.     }
  576.     public function addCommandePrestataire(CommandePrestataire $commandePrestataire)
  577.     {
  578.         if (!$this->commandePrestataire->contains($commandePrestataire)) {
  579.             $this->commandePrestataire[] = $commandePrestataire;
  580.             $commandePrestataire->setUser($this);
  581.         }
  582.         return $this;
  583.     }
  584.     public function removeCommandePrestataire(CommandePrestataire $commandePrestataire)
  585.     {
  586.         if ($this->commandePrestataire>contains($commandePrestataire)) {
  587.             $this->commandePrestataire->removeElement($commandePrestataire);
  588.             // set the owning side to null (unless already changed)
  589.             if ($commandePrestataire->getUser() === $this) {
  590.                 $commandePrestataire->setUser(null);
  591.             }
  592.         }
  593.         return $this;
  594.     }
  595.     /**
  596.      * @return Collection|FactureFournisseur[]
  597.      */
  598.     public function getFactureFournisseur()
  599.     {
  600.         return $this->factureFournisseurs;
  601.     }
  602.     public function addFactureFournisseur(FactureFournisseur $factureFournisseur)
  603.     {
  604.         if (!$this->factureFournisseur->contains($factureFournisseur)) {
  605.             $this->factureFournisseur[] = $factureFournisseur;
  606.             $factureFournisseur->setUser($this);
  607.         }
  608.         return $this;
  609.     }
  610.     public function removeFactureFournisseur(FactureFournisseur $factureFournisseur)
  611.     {
  612.         if ($this->factureFournisseur->contains($factureFournisseur)) {
  613.             $this->factureFournisseur->removeElement($factureFournisseur);
  614.             // set the owning side to null (unless already changed)
  615.             if ($factureFournisseur->getUser() === $this) {
  616.                 $factureFournisseur->setUser(null);
  617.             }
  618.         }
  619.         return $this;
  620.     }
  621.     /**
  622.      * @return Collection|FacturePrestataire[]
  623.      */
  624.     public function getFacturePrestataire()
  625.     {
  626.         return $this->facturePrestataire;
  627.     }
  628.     public function addFacturePrestataire(FacturePrestataire $facturePrestataire)
  629.     {
  630.         if (!$this->facturePrestataire->contains($facturePrestataire)) {
  631.             $this->facturePrestataire[] = $facturePrestataire;
  632.             $facturePrestataire->setUser($this);
  633.         }
  634.         return $this;
  635.     }
  636.     public function removeFacturePrestataire(FacturePrestataire $facturePrestataire)
  637.     {
  638.         if ($this->facturePrestataire->contains($facturePrestataire)) {
  639.             $this->facturePrestataire->removeElement($facturePrestataire);
  640.             // set the owning side to null (unless already changed)
  641.             if ($facturePrestataire->getUser() === $this) {
  642.                 $facturePrestataire->setUser(null);
  643.             }
  644.         }
  645.         return $this;
  646.     }
  647.     /**
  648.      * @return Collection|Devis[]
  649.      */
  650.     public function getDevis()
  651.     {
  652.         return $this->devis;
  653.     }
  654.     public function addDevi(Devis $devi)
  655.     {
  656.         if (!$this->devis->contains($devi)) {
  657.             $this->devis[] = $devi;
  658.             $devi->setUser($this);
  659.         }
  660.         return $this;
  661.     }
  662.     public function removeDevi(Devis $devi)
  663.     {
  664.         if ($this->devis->contains($devi)) {
  665.             $this->devis->removeElement($devi);
  666.             // set the owning side to null (unless already changed)
  667.             if ($devi->getUser() === $this) {
  668.                 $devi->setUser(null);
  669.             }
  670.         }
  671.         return $this;
  672.     }
  673.     /**
  674.      * @return Collection|Attachement[]
  675.      */
  676.     public function getAttachements()
  677.     {
  678.         return $this->attachements;
  679.     }
  680.     public function addAttachements(Attachement $attachement)
  681.     {
  682.         if (!$this->attachements->contains($attachement)) {
  683.             $this->attachements[] = $attachement;
  684.             $attachement->setUser($this);
  685.         }
  686.         return $this;
  687.     }
  688.     public function removeAttachements(Attachement $attachement)
  689.     {
  690.         if ($this->attachements->contains($attachement)) {
  691.             $this->attachements->removeElement($attachement);
  692.             // set the owning side to null (unless already changed)
  693.             if ($attachement->getUser() === $this) {
  694.                 $attachement->setUser(null);
  695.             }
  696.         }
  697.         return $this;
  698.     }
  699.     /**
  700.      * @return Collection|Facture[]
  701.      */
  702.     public function getFactures()
  703.     {
  704.         return $this->factures;
  705.     }
  706.     public function addFacture(Facture $facture)
  707.     {
  708.         if (!$this->factures->contains($facture)) {
  709.             $this->factures[] = $facture;
  710.             $facture->setUser($this);
  711.         }
  712.         return $this;
  713.     }
  714.     public function removeFacture(Facture $facture)
  715.     {
  716.         if ($this->factures->contains($facture)) {
  717.             $this->factures->removeElement($facture);
  718.             // set the owning side to null (unless already changed)
  719.             if ($facture->getUser() === $this) {
  720.                 $facture->setUser(null);
  721.             }
  722.         }
  723.         return $this;
  724.     }
  725.     /**
  726.      * @return Collection|Organisme[]
  727.      */
  728.     public function getOrganismes()
  729.     {
  730.         return $this->organismes;
  731.     }
  732.     /**
  733.      * @return Collection|DataView[]
  734.      */
  735.     public function getDataViews(): Collection
  736.     {
  737.         return $this->dataViews;
  738.     }
  739.     public function addDataView(DataView $dataView): self
  740.     {
  741.         if (!$this->dataViews->contains($dataView)) {
  742.             $this->dataViews[] = $dataView;
  743.             $dataView->setOwner($this);
  744.         }
  745.         return $this;
  746.     }
  747.     public function removeDataView(DataView $dataView): self
  748.     {
  749.         if ($this->dataViews->contains($dataView)) {
  750.             $this->dataViews->removeElement($dataView);
  751.             // set the owning side to null (unless already changed)
  752.             if ($dataView->getOwner() === $this) {
  753.                 $dataView->setOwner(null);
  754.             }
  755.         }
  756.         return $this;
  757.     }
  758.     public function getEntite(): ?Entite
  759.     {
  760.         return $this->entite;
  761.     }
  762.     public function setEntite(?Entite $entite): self
  763.     {
  764.         $this->entite $entite;
  765.         return $this;
  766.     }
  767.     /**
  768.      * @return Collection|UserArticle[]
  769.      */
  770.     public function getUserArticles(): Collection
  771.     {
  772.         return $this->userArticles;
  773.     }
  774.     public function addUserArticle(UserArticle $userArticle): self
  775.     {
  776.         if (!$this->userArticles->contains($userArticle)) {
  777.             $this->userArticles[] = $userArticle;
  778.             $userArticle->setUser($this);
  779.         }
  780.         return $this;
  781.     }
  782.     public function removeUserArticle(UserArticle $userArticle): self
  783.     {
  784.         if ($this->userArticles->removeElement($userArticle)) {
  785.             // set the owning side to null (unless already changed)
  786.             if ($userArticle->getUser() === $this) {
  787.                 $userArticle->setUser(null);
  788.             }
  789.         }
  790.         return $this;
  791.     }
  792.     /**
  793.      * @return Collection|AvancementCommande[]
  794.      */
  795.     public function getAvancementCommandes(): Collection
  796.     {
  797.         return $this->avancementCommandes;
  798.     }
  799.     public function addAvancementCommande(AvancementCommande $avancementCommande): self
  800.     {
  801.         if (!$this->avancementCommandes->contains($avancementCommande)) {
  802.             $this->avancementCommandes[] = $avancementCommande;
  803.             $avancementCommande->setEditor($this);
  804.         }
  805.         return $this;
  806.     }
  807.     public function removeAvancementCommande(AvancementCommande $avancementCommande): self
  808.     {
  809.         if ($this->avancementCommandes->removeElement($avancementCommande)) {
  810.             // set the owning side to null (unless already changed)
  811.             if ($avancementCommande->getEditor() === $this) {
  812.                 $avancementCommande->setEditor(null);
  813.             }
  814.         }
  815.         return $this;
  816.     }
  817.     /**
  818.      * @return Collection|AvancementCommandeFournisseur[]
  819.      */
  820.     public function getAvancementCommandeFournisseurs(): Collection
  821.     {
  822.         return $this->avancementCommandeFournisseurs;
  823.     }
  824.     public function addAvancementCommandeFournisseur(AvancementCommandeFournisseur $avancementCommandeFournisseur): self
  825.     {
  826.         if (!$this->avancementCommandeFournisseurs->contains($avancementCommandeFournisseur)) {
  827.             $this->avancementCommandeFournisseurs[] = $avancementCommandeFournisseur;
  828.             $avancementCommandeFournisseur->setEditor($this);
  829.         }
  830.         return $this;
  831.     }
  832.     public function removeAvancementCommandeFournisseur(AvancementCommandeFournisseur $avancementCommandeFournisseur): self
  833.     {
  834.         if ($this->avancementCommandeFournisseurs->removeElement($avancementCommandeFournisseur)) {
  835.             // set the owning side to null (unless already changed)
  836.             if ($avancementCommandeFournisseur->getEditor() === $this) {
  837.                 $avancementCommandeFournisseur->setEditor(null);
  838.             }
  839.         }
  840.         return $this;
  841.     }
  842.     /**
  843.      * @return Collection|Parametre[]
  844.      */
  845.     public function getParametres(): Collection
  846.     {
  847.         return $this->parametres;
  848.     }
  849.     public function addParametre(Parametre $parametre): self
  850.     {
  851.         if (!$this->parametres->contains($parametre)) {
  852.             $this->parametres[] = $parametre;
  853.             $parametre->setOwner($this);
  854.         }
  855.         return $this;
  856.     }
  857.     public function removeParametre(Parametre $parametre): self
  858.     {
  859.         if ($this->parametres->removeElement($parametre)) {
  860.             // set the owning side to null (unless already changed)
  861.             if ($parametre->getOwner() === $this) {
  862.                 $parametre->setOwner(null);
  863.             }
  864.         }
  865.         return $this;
  866.     }
  867.     public function getLastConnexionAt(): ?string
  868.     {
  869.         return $this->lastConnexionAt;
  870.     }
  871.     public function setLastConnexionAt(?string $lastConnexionAt): self
  872.     {
  873.         $this->lastConnexionAt $lastConnexionAt;
  874.         return $this;
  875.     }
  876. }