src/Entity/StoreCentralPurchasingRelation.php line 16

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\StoreCentralPurchasingRelationRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
  6. /**
  7.  * @ORM\Entity(repositoryClass=StoreCentralPurchasingRelationRepository::class)
  8.  * @ORM\EntityListeners({"App\Listener\StoreCentralPurchasingRelationListener"})
  9.  * @UniqueEntity(
  10.  *     fields={"store", "centralPurchasing"},
  11.  *     message="Cette relation existe déjà"
  12.  * )
  13.  */
  14. class StoreCentralPurchasingRelation
  15. {
  16.     /**
  17.      * @ORM\Id()
  18.      * @ORM\GeneratedValue()
  19.      * @ORM\Column(type="integer")
  20.      */
  21.     private $id;
  22.     /**
  23.      * @ORM\ManyToOne(targetEntity=Store::class, inversedBy="storeCentralPurchasingRelations")
  24.      * @ORM\JoinColumn(nullable=false)
  25.      */
  26.     private $store;
  27.     /**
  28.      * @ORM\ManyToOne(targetEntity=CentralPurchasing::class, inversedBy="storeCentralPurchasingRelations")
  29.      * @ORM\JoinColumn(nullable=false)
  30.      */
  31.     private $centralPurchasing;
  32.     /**
  33.      * @ORM\Column(type="boolean")
  34.      */
  35.     private $enabled=1;
  36.     public function getId(): ?int
  37.     {
  38.         return $this->id;
  39.     }
  40.     public function getStore(): ?Store
  41.     {
  42.         return $this->store;
  43.     }
  44.     public function setStore(?Store $store): self
  45.     {
  46.         $this->store $store;
  47.         return $this;
  48.     }
  49.     public function getCentralPurchasing(): ?CentralPurchasing
  50.     {
  51.         return $this->centralPurchasing;
  52.     }
  53.     public function setCentralPurchasing(?CentralPurchasing $centralPurchasing): self
  54.     {
  55.         $this->centralPurchasing $centralPurchasing;
  56.         return $this;
  57.     }
  58.     public function getEnabled(): ?bool
  59.     {
  60.         return $this->enabled;
  61.     }
  62.     public function isEnabled(): ?bool
  63.     {
  64.         return $this->getEnabled();
  65.     }
  66.     public function setEnabled(bool $enabled): self
  67.     {
  68.         $this->enabled $enabled;
  69.         return $this;
  70.     }
  71. }