src/Entity/GestionComerciale/EtatCommande.php line 21

Open in your IDE?
  1. <?php
  2. namespace App\Entity\GestionComerciale;
  3. use App\Entity\Utilisateur\Utilisateur;
  4. use DateTime;
  5. use Doctrine\Common\Collections\ArrayCollection;
  6. use Doctrine\Common\Collections\Collection;
  7. use Doctrine\ORM\Mapping as ORM;
  8. use Gedmo\Mapping\Annotation as Gedmo;
  9. use Symfony\Component\Validator\Constraints as Assert;
  10. use App\Annotations\SecuredEntity;
  11. /**
  12.  * EtatCommande
  13.  *
  14.  * @ORM\Table("commerciale__etat_commande")
  15.  * @ORM\Entity(repositoryClass="App\Repository\GestionComerciale\EtatCommandeRepository")
  16.  * @Gedmo\SoftDeleteable(fieldName="dateSuppression",timeAware=false)
  17.  * @SecuredEntity(name="Etat Commande", group="REGLAGES")
  18.  */
  19. class EtatCommande
  20. {
  21.     /**
  22.      * @ORM\Column(name="id", type="integer")
  23.      * @ORM\Id
  24.      * @ORM\GeneratedValue(strategy="AUTO")
  25.      */
  26.     private $id;
  27.     /**
  28.      * @ORM\Column(name="libelle", type="string", length=255, nullable=true)
  29.      * @Assert\NotBlank(message="LibellĂ© obligatoire")     
  30.      */
  31.     private $libelle;
  32.     
  33.     /**
  34.      * @ORM\ManyToOne(targetEntity="App\Entity\Utilisateur\Utilisateur", inversedBy="etatCommande")
  35.      * @ORM\JoinColumn(nullable=true)
  36.      */
  37.     private $utilisateur;
  38.     
  39.     /**
  40.      * @ORM\OneToMany(targetEntity="App\Entity\GestionComerciale\Commande", mappedBy="etatCommande")
  41.      */
  42.     private $commandes;
  43.     /**
  44.      * @ORM\Column(name="date", type="datetime", nullable=true)
  45.      */
  46.     private $date;
  47.     /**
  48.      * @ORM\Column(name="dateSuppression", type="datetime", nullable=true)
  49.      */
  50.     private $dateSuppression;
  51.     /**
  52.      * @ORM\Column(name="ordre", type="integer", nullable=true)
  53.      */
  54.     private $ordre;
  55.     /**
  56.      * @ORM\Column(name="dateMaj", type="datetime", nullable=true)
  57.      * @Gedmo\Timestampable(on="update")     
  58.      */
  59.     private $dateMaj;
  60.     public function __construct()
  61.     {
  62.         $this->date         = new Datetime();
  63.         $this->ordre        0;
  64.         $this->commandes    = new ArrayCollection();
  65.     }
  66.     public function getId(): int
  67.     {
  68.         return $this->id;
  69.     }
  70.     public function setLibelle(?string $libelle): EtatCommande
  71.     {
  72.         $this->libelle $libelle;
  73.         return $this;
  74.     }
  75.     public function getLibelle(): ?string
  76.     {
  77.         return $this->libelle;
  78.     }
  79.     public function setDate(?DateTime $date): EtatCommande
  80.     {
  81.         $this->date $date;
  82.         return $this;
  83.     }
  84.     public function getDate(): ?DateTime
  85.     {
  86.         return $this->date;
  87.     }
  88.     public function setDateSuppression(?DateTime $dateSuppression): EtatCommande
  89.     {
  90.         $this->dateSuppression $dateSuppression;
  91.         return $this;
  92.     }
  93.     public function getDateSuppression(): ?DateTime
  94.     {
  95.         return $this->dateSuppression;
  96.     }
  97.     public function setOrdre(?int $ordre): EtatCommande
  98.     {
  99.         $this->ordre $ordre;
  100.         return $this;
  101.     }
  102.     public function getOrdre(): ?int
  103.     {
  104.         return $this->ordre;
  105.     }
  106.     public function setDateMaj(?DateTime $dateMaj): EtatCommande
  107.     {
  108.         $this->dateMaj $dateMaj;
  109.         return $this;
  110.     }
  111.     public function getDateMaj(): ?DateTime
  112.     {
  113.         return $this->dateMaj;
  114.     }
  115.     public function setUtilisateur(?Utilisateur $utilisateur): EtatCommande
  116.     {
  117.         $this->utilisateur $utilisateur;
  118.         return $this;
  119.     }
  120.     public function getUtilisateur(): ?Utilisateur
  121.     {
  122.         return $this->utilisateur;
  123.     }
  124.     public function addCommande(Commande $commandes): EtatCommande
  125.     {
  126.         $this->commandes[] = $commandes;
  127.         return $this;
  128.     }
  129.     public function removeCommande(Commande $commandes)
  130.     {
  131.         $this->commandes->removeElement($commandes);
  132.     }
  133.     public function getCommandes(): Collection
  134.     {
  135.         return $this->commandes;
  136.     }
  137. }