src/Entity/Articles/NumeroSerie.php line 18

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Articles;
  3. use App\Entity\GestionComerciale\ArticleCommande;
  4. use App\Entity\Utilisateur\Utilisateur;
  5. use DateTime;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use Gedmo\Mapping\Annotation as Gedmo;
  8. use Symfony\Component\Validator\Constraints as Assert;
  9. /**
  10.  * NumeroSerie
  11.  *
  12.  * @ORM\Table("article__numero_serie")
  13.  * @ORM\Entity(repositoryClass="App\Repository\Articles\NumeroSerieRepository")
  14. */
  15. class NumeroSerie
  16. {
  17.     /**
  18.      * @ORM\Column(name="id", type="integer")
  19.      * @ORM\Id
  20.      * @ORM\GeneratedValue(strategy="AUTO")
  21.      */
  22.     private $id;
  23.     
  24.     /**
  25.      * @ORM\ManyToOne(targetEntity="App\Entity\GestionComerciale\ArticleCommande", inversedBy="numeroSerie")
  26.      * @ORM\JoinColumn(nullable=true)
  27.      */
  28.     private $articleCommande
  29.     
  30.     /**
  31.      * @ORM\Column(name="duree_garantie", type="float", nullable=true)
  32.      */
  33.     private $dureeGarantie;    
  34.        
  35.     /**
  36.      * @ORM\ManyToOne(targetEntity="App\Entity\Utilisateur\Utilisateur", inversedBy="numeroSerie")
  37.      * @ORM\JoinColumn(nullable=true)
  38.      */
  39.     private $utilisateur;    
  40.     /**
  41.      * @ORM\Column(name="numero", type="string", length=255, nullable=true)
  42.      */
  43.     private $numero;
  44.     /**
  45.      * @ORM\Column(name="date", type="datetime", nullable=true)
  46.      */
  47.     private $date;
  48.     /**
  49.      * @ORM\Column(name="dateMaj", type="datetime", nullable=true)
  50.      * @Gedmo\Timestampable(on="update")     
  51.      */
  52.     private $dateMaj;
  53.      /**
  54.      * @ORM\Column(name="date_supression", type="datetime", nullable=true)
  55.      */
  56.     private $dateSuppression;
  57.     
  58.     public function __construct()
  59.     {
  60.         $this->date = new Datetime();
  61.         
  62.     }
  63.     public function getId(): int
  64.     {
  65.         return $this->id;
  66.     }
  67.     public function setNumero(?string $numero): NumeroSerie
  68.     {
  69.         $this->numero $numero;
  70.         return $this;
  71.     }
  72.     public function getNumero(): ?string
  73.     {
  74.         return $this->numero;
  75.     }
  76.     public function setDate(?DateTime $date): NumeroSerie
  77.     {
  78.         $this->date $date;
  79.         return $this;
  80.     }
  81.     public function getDate(): ?DateTime
  82.     {
  83.         return $this->date;
  84.     }
  85.     public function setDateMaj(?DateTime $dateMaj): NumeroSerie
  86.     {
  87.         $this->dateMaj $dateMaj;
  88.         return $this;
  89.     }
  90.     public function getDateMaj(): ?DateTime
  91.     {
  92.         return $this->dateMaj;
  93.     }
  94.     public function setUtilisateur(?Utilisateur $utilisateur): NumeroSerie
  95.     {
  96.         $this->utilisateur $utilisateur;
  97.         return $this;
  98.     }
  99.     public function getUtilisateur(): ?Utilisateur
  100.     {
  101.         return $this->utilisateur;
  102.     }
  103.     public function setArticleCommande(?ArticleCommande $articleCommande): NumeroSerie
  104.     {
  105.         $this->articleCommande $articleCommande;
  106.         return $this;
  107.     }
  108.     public function getArticleCommande(): ?ArticleCommande
  109.     {
  110.         return $this->articleCommande;
  111.     }
  112.     public function setDureeGarantie(?float $dureeGarantie): NumeroSerie
  113.     {
  114.         if($dureeGarantie == ""$dureeGarantie NULL;
  115.         $this->dureeGarantie $dureeGarantie;
  116.         return $this;
  117.     }
  118.     public function getDureeGarantie(): ?float
  119.     {
  120.         return $this->dureeGarantie;
  121.     }
  122.     public function setDateSuppression(?DateTime $dateSuppression): NumeroSerie
  123.     {
  124.         $this->dateSuppression $dateSuppression;
  125.         return $this;
  126.     }
  127.     public function getDateSuppression(): ?DateTime
  128.     {
  129.         return $this->dateSuppression;
  130.     }
  131. }