src/Entity/Articles/UniteMesure.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. use App\Annotations\SecuredEntity;
  9. /**
  10.  * UniteMesure
  11.  *
  12.  * @ORM\Table("article__unite_mesure")
  13.  * @ORM\Entity(repositoryClass="App\Repository\Articles\UniteMesureRepository")
  14.  * @SecuredEntity (name="UnitĂ© de mesure", group="ARTICLES")
  15.  */
  16. class UniteMesure
  17. {
  18.     /**
  19.      * @ORM\Column(name="id", type="integer")
  20.      * @ORM\Id
  21.      * @ORM\GeneratedValue(strategy="AUTO")
  22.      */
  23.     private $id;
  24.     
  25.     /**
  26.      * @ORM\Column(name="reference", type="string", length=255, nullable=true)
  27.      */
  28.     private $reference;
  29.     
  30.     /**
  31.      * @var float
  32.      *
  33.      * @ORM\Column(name="multiplicateur", type="float", nullable=true)
  34.      */
  35.     private $multiplicateur;    
  36.     
  37.     /**
  38.      * @ORM\Column(name="valeur_entiere", type="boolean", nullable=true)
  39.      */
  40.     private $valeurEntiere;
  41.     
  42.     /**
  43.      * @ORM\ManyToOne(targetEntity="App\Entity\Utilisateur\Utilisateur", inversedBy="uniteMesure")
  44.      * @ORM\JoinColumn(nullable=true)
  45.      */
  46.     private $utilisateur;
  47.     /**
  48.      * @ORM\Column(name="libelle", type="string", length=255, nullable=true)
  49.      * @Assert\NotBlank(message="LibellĂ© obligatoire") 
  50.      */
  51.     private $libelle;
  52.     /**
  53.      * @ORM\Column(name="date", type="datetime", nullable=true)
  54.      */
  55.     private $date;
  56.     /**
  57.      * @ORM\Column(name="date_suppression", type="datetime", nullable=true)
  58.      */
  59.     private $dateSuppression;
  60.     /**
  61.      * @ORM\Column(name="date_maj", type="datetime", nullable=true)
  62.      * @Gedmo\Timestampable(on="update")
  63.      */
  64.     private $dateMaj;
  65.     /**
  66.      * @ORM\Column(name="idImport", type="string", length=255, nullable=true)
  67.      */
  68.     private $idImport;
  69.     
  70.     public function __construct()
  71.     {
  72.         $this->date = new Datetime();
  73.     }
  74.     public function getId(): int
  75.     {
  76.         return $this->id;
  77.     }
  78.     public function setLibelle(?string $libelle): UniteMesure
  79.     {
  80.         $this->libelle $libelle;
  81.         return $this;
  82.     }
  83.     public function getLibelle(): ?string
  84.     {
  85.         return $this->libelle;
  86.     }
  87.     public function setDate(?DateTime $date): UniteMesure
  88.     {
  89.         $this->date $date;
  90.         return $this;
  91.     }
  92.     public function getDate(): ?DateTime
  93.     {
  94.         return $this->date;
  95.     }
  96.     public function setDateSuppression(?DateTime $dateSuppression): UniteMesure
  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): UniteMesure
  106.     {
  107.         $this->dateMaj $dateMaj;
  108.         return $this;
  109.     }
  110.     public function getDateMaj(): ?DateTime
  111.     {
  112.         return $this->dateMaj;
  113.     }
  114.     public function setIdImport(?string $idImport): UniteMesure
  115.     {
  116.         $this->idImport $idImport;
  117.         return $this;
  118.     }
  119.     public function getIdImport(): ?string
  120.     {
  121.         return $this->idImport;
  122.     }
  123.     public function setUtilisateur(?Utilisateur $utilisateur): UniteMesure
  124.     {
  125.         $this->utilisateur $utilisateur;
  126.         return $this;
  127.     }
  128.     public function getUtilisateur(): ?Utilisateur
  129.     {
  130.         return $this->utilisateur;
  131.     }
  132.     
  133.     public function __toString() {
  134.         return $this->libelle;
  135.     }
  136.     public function setReference(?string $reference): UniteMesure
  137.     {
  138.         $this->reference $reference;
  139.         return $this;
  140.     }
  141.     public function getReference(): ?string
  142.     {
  143.         return $this->reference;
  144.     }
  145.     public function setValeurEntiere(?bool $valeurEntiere): UniteMesure
  146.     {
  147.         $this->valeurEntiere $valeurEntiere;
  148.         return $this;
  149.     }
  150.     public function getValeurEntiere(): ?bool
  151.     {
  152.         return $this->valeurEntiere;
  153.     }
  154.     public function setMultiplicateur(?int $multiplicateur): UniteMesure
  155.     {
  156.         $this->multiplicateur $multiplicateur;
  157.         return $this;
  158.     }
  159.     public function getMultiplicateur(): ?float
  160.     {
  161.         return $this->multiplicateur;
  162.     }
  163. }