src/Entity/CRM/Implementer.php line 12

  1. <?php
  2. namespace App\Entity\CRM;
  3. use App\Entity\CRM\Order;
  4. use App\Repository\ImplementerRepository;
  5. use Doctrine\Common\Collections\ArrayCollection;
  6. use Doctrine\Common\Collections\Collection;
  7. use Doctrine\ORM\Mapping as ORM;
  8. #[ORM\Entity(repositoryClassImplementerRepository::class)]
  9. class Implementer
  10. {
  11.     #[ORM\Id]
  12.     #[ORM\GeneratedValue]
  13.     #[ORM\Column]
  14.     private ?int $id null;
  15.     #[ORM\OneToOne(inversedBy'implementer'cascade: ['persist''remove'])]
  16.     #[ORM\JoinColumn(nullablefalse)]
  17.     private ?Admin $admin null;
  18.     #[ORM\Column]
  19.     private ?bool $isActive null;
  20.     #[ORM\Column(length255)]
  21.     private ?string $backColor null;
  22.     #[ORM\Column]
  23.     private ?bool $forBhp null;
  24.     #[ORM\ManyToMany(targetEntityOrder::class, mappedBy'implementer')]
  25.     private Collection $orders;
  26.     #[ORM\ManyToMany(targetEntityImplementerOrderProduct::class, mappedBy'implementer')]
  27.     private Collection $implementerOrderProducts;
  28.     #[ORM\ManyToMany(targetEntityBhpOrderProduct::class, mappedBy'implementer')]
  29.     private Collection $bhpOrderProducts;
  30.     #[ORM\Column]
  31.     private ?int $sortOrder 999;
  32.     public function __construct()
  33.     {
  34.         $this->orders = new ArrayCollection();
  35.         $this->implementerOrderProducts = new ArrayCollection();
  36.         $this->bhpOrderProducts = new ArrayCollection();
  37.     }
  38.     public function __toString()
  39.     {
  40.         return $this->getAdmin()->getFirstName().' '.$this->getAdmin()->getLastName();
  41.     }
  42.     public function getId(): ?int
  43.     {
  44.         return $this->id;
  45.     }
  46.     public function getAdmin(): ?Admin
  47.     {
  48.         return $this->admin;
  49.     }
  50.     public function setAdmin(Admin $admin): self
  51.     {
  52.         $this->admin $admin;
  53.         return $this;
  54.     }
  55.     public function isIsActive(): ?bool
  56.     {
  57.         return $this->isActive;
  58.     }
  59.     public function setIsActive(bool $isActive): self
  60.     {
  61.         $this->isActive $isActive;
  62.         return $this;
  63.     }
  64.     public function getBackColor(): ?string
  65.     {
  66.         return $this->backColor;
  67.     }
  68.     public function setBackColor(string $backColor): self
  69.     {
  70.         $this->backColor $backColor;
  71.         return $this;
  72.     }
  73.     public function isForBhp(): ?bool
  74.     {
  75.         return $this->forBhp;
  76.     }
  77.     public function setForBhp(bool $forBhp): self
  78.     {
  79.         $this->forBhp $forBhp;
  80.         return $this;
  81.     }
  82.     /**
  83.      * @return Collection<int, Order>
  84.      */
  85.     public function getOrders(): Collection
  86.     {
  87.         return $this->orders;
  88.     }
  89.     public function addOrder(Order $order): self
  90.     {
  91.         if (!$this->orders->contains($order)) {
  92.             $this->orders->add($order);
  93.             $order->addImplementer($this);
  94.         }
  95.         return $this;
  96.     }
  97.     public function removeOrder(Order $order): self
  98.     {
  99.         if ($this->orders->removeElement($order)) {
  100.             $order->removeImplementer($this);
  101.         }
  102.         return $this;
  103.     }
  104.     /**
  105.      * @return Collection<int, ImplementerOrderProduct>
  106.      */
  107.     public function getImplementerOrderProducts(): Collection
  108.     {
  109.         return $this->implementerOrderProducts;
  110.     }
  111.     public function addImplementerOrderProduct(ImplementerOrderProduct $implementerOrderProduct): static
  112.     {
  113.         if (!$this->implementerOrderProducts->contains($implementerOrderProduct)) {
  114.             $this->implementerOrderProducts->add($implementerOrderProduct);
  115.             $implementerOrderProduct->addImplementer($this);
  116.         }
  117.         return $this;
  118.     }
  119.     public function removeImplementerOrderProduct(ImplementerOrderProduct $implementerOrderProduct): static
  120.     {
  121.         if ($this->implementerOrderProducts->removeElement($implementerOrderProduct)) {
  122.             $implementerOrderProduct->removeImplementer($this);
  123.         }
  124.         return $this;
  125.     }
  126.     /**
  127.      * @return Collection<int, BhpOrderProduct>
  128.      */
  129.     public function getBhpOrderProducts(): Collection
  130.     {
  131.         return $this->bhpOrderProducts;
  132.     }
  133.     public function addBhpOrderProduct(BhpOrderProduct $bhpOrderProduct): static
  134.     {
  135.         if (!$this->bhpOrderProducts->contains($bhpOrderProduct)) {
  136.             $this->bhpOrderProducts->add($bhpOrderProduct);
  137.             $bhpOrderProduct->addImplementer($this);
  138.         }
  139.         return $this;
  140.     }
  141.     public function removeBhpOrderProduct(BhpOrderProduct $bhpOrderProduct): static
  142.     {
  143.         if ($this->bhpOrderProducts->removeElement($bhpOrderProduct)) {
  144.             $bhpOrderProduct->removeImplementer($this);
  145.         }
  146.         return $this;
  147.     }
  148.     public function getSortOrder(): ?int
  149.     {
  150.         return $this->sortOrder;
  151.     }
  152.     public function setSortOrder(int $sortOrder): static
  153.     {
  154.         $this->sortOrder $sortOrder;
  155.         return $this;
  156.     }
  157. }