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