src/Entity/Articles/Garantie.php line 18

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Articles;
  3. use App\Entity\Utilisateur\Utilisateur;
  4. use DateTime;
  5. use Doctrine\ORM\Mapping as ORM;
  6. use Gedmo\Mapping\Annotation as Gedmo;
  7. use Symfony\Component\Validator\Constraints as Assert;
  8. /**
  9.  * Garantie
  10.  *
  11.  * @ORM\Table("article__garantie")
  12.  * @ORM\Entity(repositoryClass="App\Repository\Articles\GarantieRepository")
  13.  * @Gedmo\SoftDeleteable(fieldName="dateSuppression",timeAware=false)
  14.  */
  15. class Garantie
  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\Utilisateur\Utilisateur", inversedBy="garantie")
  26.      * @ORM\JoinColumn(nullable=true)
  27.      */
  28.     private $utilisateur;
  29.     
  30.     /**
  31.      * @ORM\ManyToOne(targetEntity="App\Entity\Articles\Article", inversedBy="garanties")
  32.      * @ORM\JoinColumn(nullable=true)
  33.      */
  34.     private $article;
  35.     /**
  36.      * @ORM\Column(name="libelle", type="string", length=255, nullable=true)
  37.      * @Assert\NotBlank(message="LibellĂ© obligatoire")     
  38.      */
  39.     private $libelle;
  40.     /**
  41.      * @ORM\Column(name="date", type="datetime", nullable=true)
  42.      */
  43.     private $date;
  44.     /**
  45.      * @ORM\Column(name="dateFin", type="datetime", nullable=true)
  46.      */
  47.     private $dateFin;
  48.     /**
  49.      * @ORM\Column(name="dateSuppression", type="datetime", nullable=true)
  50.      */
  51.     private $dateSuppression;
  52.     /**
  53.      * @ORM\Column(name="dateMaj", type="datetime", nullable=true)
  54.      * @Gedmo\Timestampable(on="update")
  55.      */
  56.     private $dateMaj;
  57.     /**
  58.      * @ORM\Column(name="referenceArticle", type="text", nullable=true)
  59.      */
  60.     private $referenceArticle;
  61.     public function __construct()
  62.     {
  63.         $this->date = new Datetime();
  64.     }
  65.     public function getId(): int
  66.     {
  67.         return $this->id;
  68.     }
  69.     public function setLibelle(?string $libelle): Garantie
  70.     {
  71.         $this->libelle $libelle;
  72.         return $this;
  73.     }
  74.     public function getLibelle(): ?string
  75.     {
  76.         return $this->libelle;
  77.     }
  78.     public function setDate(?DateTime $date): Garantie
  79.     {
  80.         $this->date $date;
  81.         return $this;
  82.     }
  83.     public function getDate(): ?DateTime
  84.     {
  85.         return $this->date;
  86.     }
  87.     public function setDateFin(?DateTime $dateFin): Garantie
  88.     {
  89.         $this->dateFin $dateFin;
  90.         return $this;
  91.     }
  92.     public function getDateFin(): ?DateTime
  93.     {
  94.         return $this->dateFin;
  95.     }
  96.     public function setDateSuppression(?DateTime $dateSuppression): Garantie
  97.     {
  98.         $this->dateSuppression $dateSuppression;
  99.         return $this;
  100.     }
  101.     public function getDateSuppression(): ?DateTime
  102.     {
  103.         return $this->dateSuppression;
  104.     }
  105.     public function setDateMaj(?DateTime $dateMaj): Garantie
  106.     {
  107.         $this->dateMaj $dateMaj;
  108.         return $this;
  109.     }
  110.     public function getDateMaj(): ?DateTime
  111.     {
  112.         return $this->dateMaj;
  113.     }
  114.     public function setReferenceArticle(?string $referenceArticle): Garantie
  115.     {
  116.         $this->referenceArticle $referenceArticle;
  117.         return $this;
  118.     }
  119.     public function getReferenceArticle(): ?string
  120.     {
  121.         return $this->referenceArticle;
  122.     }
  123.     
  124.     public function __toString() {
  125.         return $this->libelle;
  126.     }
  127.     public function setUtilisateur(?Utilisateur $utilisateur): Garantie
  128.     {
  129.         $this->utilisateur $utilisateur;
  130.         return $this;
  131.     }
  132.     public function getUtilisateur(): ?Utilisateur
  133.     {
  134.         return $this->utilisateur;
  135.     }
  136.     public function setArticle(?Article $article): Garantie
  137.     {
  138.         $this->article $article;
  139.         return $this;
  140.     }
  141.     public function getArticle(): ?Article
  142.     {
  143.         return $this->article;
  144.     }
  145. }