src/Entity/CRM/BhpOrderProduct.php line 15

  1. <?php
  2. namespace App\Entity\CRM;
  3. use App\Entity\CRM\Order;
  4. use App\Entity\CRM\OrderProduct;
  5. use App\Repository\BhpOrderProductRepository;
  6. use DateTimeInterface;
  7. use Doctrine\Common\Collections\ArrayCollection;
  8. use Doctrine\Common\Collections\Collection;
  9. use Doctrine\DBAL\Types\Types;
  10. use Doctrine\ORM\Mapping as ORM;
  11. #[ORM\Entity(repositoryClassBhpOrderProductRepository::class)]
  12. class BhpOrderProduct
  13. {
  14.     #[ORM\Id]
  15.     #[ORM\GeneratedValue]
  16.     #[ORM\Column]
  17.     private ?int $id null;
  18.     #[ORM\Column(typeTypes::DATETIME_MUTABLEnullabletrue)]
  19.     private ?DateTimeInterface $dateOfAssignment null;
  20.     #[ORM\ManyToOne(inversedBy'BhpOrderProducts')]
  21.     private ?BhpStatus $bhpStatus null;
  22.     #[ORM\ManyToOne(inversedBy'BhpOrderProducts')]
  23.     private ?Branch $branch null;
  24.     #[ORM\ManyToOne(inversedBy'BhpOrderProducts')]
  25.     private ?Order $orderInstance null;
  26.     #[ORM\ManyToOne(inversedBy'BhpOrderProducts')]
  27.     private ?OrderProduct $orderProduct null;
  28.     #[ORM\ManyToOne(inversedBy'bhpOrderProducts')]
  29.     private ?BhpInspector $bhpInspector null;
  30.     #[ORM\OneToMany(mappedBy'bhpOrderProduct'targetEntityBhpOrderProductSettlements::class, orphanRemovaltrue)]
  31.     private Collection $bhpOrderProductSettlements;
  32.     #[ORM\OneToMany(mappedBy'BhpOrderProduct'targetEntityBhpJournals::class, orphanRemovaltrue)]
  33.     private Collection $bhpJournals;
  34.     #[ORM\ManyToMany(targetEntityImplementer::class, inversedBy'bhpOrderProducts')]
  35.     private Collection $implementer;
  36.     public function __construct()
  37.     {
  38.         $this->bhpOrderProductSettlements = new ArrayCollection();
  39.         $this->bhpJournals = new ArrayCollection();
  40.         $this->implementer = new ArrayCollection();
  41.     }
  42.     public function __toString(): string
  43.     {
  44.         return $this->getOrderProduct();
  45.     }
  46.     public function getId(): ?int
  47.     {
  48.         return $this->id;
  49.     }
  50.     public function getDateOfAssignment(): ?DateTimeInterface
  51.     {
  52.         return $this->dateOfAssignment;
  53.     }
  54.     public function setDateOfAssignment(DateTimeInterface $dateOfAssignment): static
  55.     {
  56.         $this->dateOfAssignment $dateOfAssignment;
  57.         return $this;
  58.     }
  59.     public function getBhpStatus(): ?BhpStatus
  60.     {
  61.         return $this->bhpStatus;
  62.     }
  63.     public function setBhpStatus(?BhpStatus $bhpStatus): static
  64.     {
  65.         $this->bhpStatus $bhpStatus;
  66.         return $this;
  67.     }
  68.     public function getBranch(): ?Branch
  69.     {
  70.         return $this->branch;
  71.     }
  72.     public function setBranch(?Branch $branch): static
  73.     {
  74.         $this->branch $branch;
  75.         return $this;
  76.     }
  77.     public function getOrderInstance(): ?Order
  78.     {
  79.         return $this->orderInstance;
  80.     }
  81.     public function setOrderInstance(?Order $orderInstance): static
  82.     {
  83.         $this->orderInstance $orderInstance;
  84.         return $this;
  85.     }
  86.     public function getOrderProduct(): ?OrderProduct
  87.     {
  88.         return $this->orderProduct;
  89.     }
  90.     public function setOrderProduct(?OrderProduct $orderProduct): static
  91.     {
  92.         $this->orderProduct $orderProduct;
  93.         return $this;
  94.     }
  95.     public function getBhpInspector(): ?BhpInspector
  96.     {
  97.         return $this->bhpInspector;
  98.     }
  99.     public function setBhpInspector(?BhpInspector $bhpInspector): static
  100.     {
  101.         $this->bhpInspector $bhpInspector;
  102.         return $this;
  103.     }
  104.     /**
  105.      * @return Collection<int, BhpOrderProductSettlements>
  106.      */
  107.     public function getBhpOrderProductSettlements(): Collection
  108.     {
  109.         return $this->bhpOrderProductSettlements;
  110.     }
  111.     public function addBhpOrderProductSettlement(BhpOrderProductSettlements $bhpOrderProductSettlements): static
  112.     {
  113.         if (!$this->bhpOrderProductSettlements->contains($bhpOrderProductSettlements)) {
  114.             $this->bhpOrderProductSettlements->add($bhpOrderProductSettlements);
  115.             $bhpOrderProductSettlements->setBhpOrderProduct($this);
  116.         }
  117.         return $this;
  118.     }
  119.     public function removeBhpOrderProductSettlement(BhpOrderProductSettlements $bhpOrderProductSettlements): static
  120.     {
  121.         if ($this->bhpOrderProductSettlements->removeElement($bhpOrderProductSettlements)) {
  122.             // set the owning side to null (unless already changed)
  123.             if ($bhpOrderProductSettlements->getBhpOrderProduct() === $this) {
  124.                 $bhpOrderProductSettlements->setBhpOrderProduct(null);
  125.             }
  126.         }
  127.         return $this;
  128.     }
  129.     /**
  130.      * @return Collection<int, BhpJournals>
  131.      */
  132.     public function getBhpJournals(): Collection
  133.     {
  134.         return $this->bhpJournals;
  135.     }
  136.     public function addBhpJournal(BhpJournals $bhpJournal): static
  137.     {
  138.         if (!$this->bhpJournals->contains($bhpJournal)) {
  139.             $this->bhpJournals->add($bhpJournal);
  140.             $bhpJournal->setBhpOrderProduct($this);
  141.         }
  142.         return $this;
  143.     }
  144.     public function removeBhpJournal(BhpJournals $bhpJournal): static
  145.     {
  146.         if ($this->bhpJournals->removeElement($bhpJournal)) {
  147.             // set the owning side to null (unless already changed)
  148.             if ($bhpJournal->getBhpOrderProduct() === $this) {
  149.                 $bhpJournal->setBhpOrderProduct(null);
  150.             }
  151.         }
  152.         return $this;
  153.     }
  154.     /**
  155.      * @return Collection<int, Implementer>
  156.      */
  157.     public function getImplementer(): Collection
  158.     {
  159.         return $this->implementer;
  160.     }
  161.     public function addImplementer(Implementer $implementer): static
  162.     {
  163.         if (!$this->implementer->contains($implementer)) {
  164.             $this->implementer->add($implementer);
  165.         }
  166.         return $this;
  167.     }
  168.     public function removeImplementer(Implementer $implementer): static
  169.     {
  170.         $this->implementer->removeElement($implementer);
  171.         return $this;
  172.     }
  173. }