src/Entity/Articles/ArticleAssocie.php line 21

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Articles;
  3. use App\Entity\GestionComerciale\ArticleCommande;
  4. use App\Entity\Utilisateur\Utilisateur;
  5. use DateTime;
  6. use Doctrine\Common\Collections\ArrayCollection;
  7. use Doctrine\Common\Collections\Collection;
  8. use Doctrine\ORM\Mapping as ORM;
  9. use Gedmo\Mapping\Annotation as Gedmo;
  10. /**
  11.  * ArticleAssocie
  12.  *
  13.  * @ORM\Table("article__article_associe")
  14.  * @ORM\Entity(repositoryClass="App\Repository\Articles\ArticleAssocieRepository")
  15.  * @Gedmo\SoftDeleteable(fieldName="dateSuppression",timeAware=false)
  16.  */
  17. class ArticleAssocie
  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\ManyToOne(targetEntity="App\Entity\Utilisateur\Utilisateur", inversedBy="articles")
  28.      * @ORM\JoinColumn(nullable=true)
  29.      */
  30.     private $utilisateur;
  31.     
  32.     /**
  33.      * @ORM\Column(name="date", type="datetime")
  34.      */
  35.     private $date;
  36.     
  37.      /**
  38.      * @ORM\Column(name="date_supression", type="datetime", nullable=true)
  39.      */
  40.     private $dateSuppression;
  41.     
  42.      /**
  43.      * @ORM\Column(name="date_maj", type="datetime", nullable=true)
  44.      * @Gedmo\Timestampable(on="update")
  45.      */
  46.     private $dateMaj;
  47.     /**
  48.     * @ORM\ManyToOne(targetEntity="App\Entity\Articles\Article", inversedBy="articlesAssociesParent")
  49.     */
  50.     private $parent;
  51.     
  52.     /**
  53.     * @ORM\ManyToOne(targetEntity="App\Entity\Articles\Article", inversedBy="articlesAssociesEnfant")
  54.     */
  55.     private $enfant;
  56.     
  57.     /**
  58.      * @ORM\Column(name="quantite", type="float", nullable=true)
  59.      */
  60.     private $quantite;
  61.     
  62.     /**
  63.      * @ORM\OneToMany(targetEntity="App\Entity\GestionComerciale\ArticleCommande", mappedBy="articleAssocie")
  64.          * @ORM\JoinColumn(nullable=true)
  65.      */
  66.     private $articlesCommande;
  67.         
  68.     /**
  69.      * @ORM\Column(name="ordre", type="integer", nullable=true)
  70.      */
  71.     private $ordre;
  72.     public function __construct()
  73.     {
  74.         $this->date = new Datetime();
  75.         $this->articlesCommande = new ArrayCollection();
  76.     }
  77.     public function getId(): int
  78.     {
  79.         return $this->id;
  80.     }
  81.     public function setDate(DateTime $date): ArticleAssocie
  82.     {
  83.         $this->date $date;
  84.         return $this;
  85.     }
  86.     public function getDate(): DateTime
  87.     {
  88.         return $this->date;
  89.     }
  90.     public function setDateSuppression(?DateTime $dateSuppression): ArticleAssocie
  91.     {
  92.         $this->dateSuppression $dateSuppression;
  93.         return $this;
  94.     }
  95.     public function getDateSuppression(): ?DateTime
  96.     {
  97.         return $this->dateSuppression;
  98.     }
  99.     public function setDateMaj(?DateTime $dateMaj): ArticleAssocie
  100.     {
  101.         $this->dateMaj $dateMaj;
  102.         return $this;
  103.     }
  104.     public function getDateMaj(): ?DateTime
  105.     {
  106.         return $this->dateMaj;
  107.     }
  108.     public function setQuantite(?float $quantite): ArticleAssocie
  109.     {
  110.         $this->quantite $quantite;
  111.         return $this;
  112.     }
  113.     public function getQuantite(): ?float
  114.     {
  115.         return $this->quantite;
  116.     }
  117.     public function setOrdre(?int $ordre): ArticleAssocie
  118.     {
  119.         $this->ordre $ordre;
  120.         return $this;
  121.     }
  122.     public function getOrdre(): ?int
  123.     {
  124.         return $this->ordre;
  125.     }
  126.     public function setUtilisateur(?Utilisateur $utilisateur): ArticleAssocie
  127.     {
  128.         $this->utilisateur $utilisateur;
  129.         return $this;
  130.     }
  131.     public function getUtilisateur(): ?Utilisateur
  132.     {
  133.         return $this->utilisateur;
  134.     }
  135.     public function setParent(?Article $parent): ArticleAssocie
  136.     {
  137.         $this->parent $parent;
  138.         return $this;
  139.     }
  140.     public function getParent(): ?Article
  141.     {
  142.         return $this->parent;
  143.     }
  144.     public function setEnfant(?Article $enfant): ArticleAssocie
  145.     {
  146.         $this->enfant $enfant;
  147.         return $this;
  148.     }
  149.     public function getEnfant(): ?Article
  150.     {
  151.         return $this->enfant;
  152.     }
  153.     public function addArticlesCommande(ArticleCommande $articlesCommande): ArticleAssocie
  154.     {
  155.         $this->articlesCommande[] = $articlesCommande;
  156.         return $this;
  157.     }
  158.     public function removeArticlesCommande(ArticleCommande $articlesCommande)
  159.     {
  160.         $this->articlesCommande->removeElement($articlesCommande);
  161.     }
  162.     public function getArticlesCommande(): Collection
  163.     {
  164.         return $this->articlesCommande;
  165.     }
  166. }