src/Entity/Articles/Type.php line 20

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. use App\Annotations\SecuredEntity;
  9. /**
  10.  * Type
  11.  *
  12.  * @ORM\Table("article__type")
  13.  * @ORM\Entity(repositoryClass="App\Repository\Articles\TypeRepository")
  14.  * @Gedmo\SoftDeleteable(fieldName="dateSuppression",timeAware=false)
  15.  * @SecuredEntity(name="Type", group="ARTICLES")
  16.  */
  17. class Type
  18. {
  19.     /**
  20.      * @ORM\Column(name="id", type="integer")
  21.      * @ORM\Id
  22.      * @ORM\GeneratedValue(strategy="AUTO")
  23.      */
  24.     private $id;
  25.     
  26.     /**
  27.      * @ORM\Column(name="reference", type="string", length=255)
  28.      * @Assert\NotBlank(message="Référence obligatoire")      
  29.      */
  30.     private $reference;
  31.     /**
  32.      * @ORM\ManyToOne(targetEntity="App\Entity\Utilisateur\Utilisateur", inversedBy="typeArticle")
  33.      * @ORM\JoinColumn(nullable=true)
  34.      */
  35.     private $utilisateur;
  36.     /**
  37.      * @ORM\Column(name="libelle", type="string", length=255, nullable=true)
  38.      * @Assert\NotBlank(message="Libellé obligatoire")       
  39.      */
  40.     private $libelle;
  41.     /**
  42.      * @ORM\Column(name="date", type="datetime", nullable=true)
  43.      */
  44.     private $date;
  45.     /**
  46.      * @ORM\Column(name="dateSuppression", type="datetime", nullable=true)
  47.      */
  48.     private $dateSuppression;
  49.     public function __construct()
  50.     {
  51.         $this->date = new Datetime();
  52.     }
  53.     public function getId(): int
  54.     {
  55.         return $this->id;
  56.     }
  57.     public function setLibelle(?string $libelle): Type
  58.     {
  59.         $this->libelle $libelle;
  60.         return $this;
  61.     }
  62.     public function getLibelle(): ?string
  63.     {
  64.         return $this->libelle;
  65.     }
  66.     public function setDate(?DateTime $date): Type
  67.     {
  68.         $this->date $date;
  69.         return $this;
  70.     }
  71.     public function getDate(): ?DateTime
  72.     {
  73.         return $this->date;
  74.     }
  75.     public function setDateSuppression(?DateTime $dateSuppression): Type
  76.     {
  77.         $this->dateSuppression $dateSuppression;
  78.         return $this;
  79.     }
  80.     public function getDateSuppression(): ?DateTime
  81.     {
  82.         return $this->dateSuppression;
  83.     }
  84.     public function setUtilisateur(?Utilisateur $utilisateur): Type
  85.     {
  86.         $this->utilisateur $utilisateur;
  87.         return $this;
  88.     }
  89.     public function getUtilisateur(): ?Utilisateur
  90.     {
  91.         return $this->utilisateur;
  92.     }
  93.     
  94.     public function __toString() {
  95.         return $this->libelle;
  96.     }
  97.     public function setReference(string $reference): Type
  98.     {
  99.         $this->reference $reference;
  100.         return $this;
  101.     }
  102.     public function getReference(): string
  103.     {
  104.         return $this->reference;
  105.     }
  106. }