src/Entity/ClientProduit.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\ClientProduitRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. /**
  6.  * @ORM\HasLifecycleCallbacks()
  7.  * @ORM\Entity(repositoryClass=ClientProduitRepository::class)
  8.  */
  9. class ClientProduit
  10. {
  11.     /**
  12.      * @ORM\Id
  13.      * @ORM\GeneratedValue
  14.      * @ORM\Column(type="integer")
  15.      */
  16.     private $id;
  17.     /**
  18.      * @ORM\ManyToOne(targetEntity=Client::class, inversedBy="clientProduits")
  19.      */
  20.     private $client;
  21.     /**
  22.      * @ORM\ManyToOne(targetEntity=Projet::class, inversedBy="clientProduits")
  23.      */
  24.     private $projet;
  25.     /**
  26.      * @ORM\ManyToOne(targetEntity=Rubrique::class, inversedBy="clientProduits")
  27.      */
  28.     private $rubrique;
  29.     /**
  30.      * @ORM\ManyToOne(targetEntity=Produit::class, inversedBy="clientProduits")
  31.      */
  32.     private $produit;
  33.     /**
  34.      * @ORM\Column(type="datetime", nullable=true)
  35.      */
  36.     private $createdAt;
  37.     /**
  38.      * @ORM\Column(type="datetime", nullable=true)
  39.      */
  40.     private $updatedAt;
  41.     /**
  42.      * @ORM\Column(type="integer", nullable=true)
  43.      */
  44.     private $orderRubrique;
  45.     /**
  46.      * @ORM\Column(type="integer", nullable=true)
  47.      */
  48.     private $orderProduit;
  49.     public function getId(): ?int
  50.     {
  51.         return $this->id;
  52.     }
  53.     public function getClient(): ?Client
  54.     {
  55.         return $this->client;
  56.     }
  57.     public function setClient(?Client $client): self
  58.     {
  59.         $this->client $client;
  60.         return $this;
  61.     }
  62.     public function getProjet(): ?Projet
  63.     {
  64.         return $this->projet;
  65.     }
  66.     public function setProjet(?Projet $projet): self
  67.     {
  68.         $this->projet $projet;
  69.         return $this;
  70.     }
  71.     public function getRubrique(): ?Rubrique
  72.     {
  73.         return $this->rubrique;
  74.     }
  75.     public function setRubrique(?Rubrique $rubrique): self
  76.     {
  77.         $this->rubrique $rubrique;
  78.         return $this;
  79.     }
  80.     public function getProduit(): ?Produit
  81.     {
  82.         return $this->produit;
  83.     }
  84.     public function setProduit(?Produit $produit): self
  85.     {
  86.         $this->produit $produit;
  87.         return $this;
  88.     }
  89.     public function getCreatedAt(): ?\DateTimeInterface
  90.     {
  91.         return $this->createdAt;
  92.     }
  93.     public function setCreatedAt(?\DateTimeInterface $createdAt): self
  94.     {
  95.         $this->createdAt $createdAt;
  96.         return $this;
  97.     }
  98.     public function getUpdatedAt(): ?\DateTimeInterface
  99.     {
  100.         return $this->updatedAt;
  101.     }
  102.     public function setUpdatedAt(?\DateTimeInterface $updatedAt): self
  103.     {
  104.         $this->updatedAt $updatedAt;
  105.         return $this;
  106.     }
  107.     /**
  108.      * @ORM\PrePersist
  109.      * @ORM\PreUpdate
  110.      */
  111.     public function updateTimer()
  112.     {
  113.         if ($this->getCreatedAt() == null) {
  114.             $this->setCreatedAt(new \DateTime());
  115.         }
  116.         $this->setUpdatedAt(new \DateTime());
  117.     }
  118.     public function getOrderRubrique(): ?int
  119.     {
  120.         return $this->orderRubrique;
  121.     }
  122.     public function setOrderRubrique(?int $orderRubrique): self
  123.     {
  124.         $this->orderRubrique $orderRubrique;
  125.         return $this;
  126.     }
  127.     public function getOrderProduit(): ?int
  128.     {
  129.         return $this->orderProduit;
  130.     }
  131.     public function setOrderProduit(?int $orderProduit): self
  132.     {
  133.         $this->orderProduit $orderProduit;
  134.         return $this;
  135.     }
  136. }