src/Component/RFQCategory/Entity/CRFQ.php line 16

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace BitBag\OpenMarketplace\Component\RFQCategory\Entity;
  4. use BitBag\OpenMarketplace\Component\Organization\Entity\OrganizationInterface;
  5. use BitBag\OpenMarketplace\Component\RFQCategory\StateMachine\CRFQStates;
  6. use BitBag\OpenMarketplace\Component\Taxonomy\Entity\TaxonInterface;
  7. use DateTimeInterface;
  8. use Doctrine\Common\Collections\ArrayCollection;
  9. use Doctrine\Common\Collections\Collection;
  10. use Sylius\Component\Addressing\Model\CountryInterface;
  11. use Sylius\Component\Resource\Model\TimestampableTrait;
  12. class CRFQ implements CRFQInterface
  13. {
  14.     use TimestampableTrait;
  15.     private ?int $id null;
  16.     private ?int $quantity null;
  17.     private ?string $approvalStatus CRFQStates::APPROVAL_STATUS_NEW;
  18.     private ?string $subject 'Request for quote';
  19.     private ?string $details null;
  20.     private ?string $revisionReason null;
  21.     protected ?DateTimeInterface $revisionDate;
  22.     private ?string $rejectedReason null;
  23.     protected ?DateTimeInterface $rejectedDate;
  24.     protected ?DateTimeInterface $deliveryDate;
  25.     protected ?DateTimeInterface $offerDeliveryDate;
  26.     private ?OrganizationInterface $buyer;
  27.     private ?TaxonInterface $category;
  28.     private ?CountryInterface $country;
  29.     private Collection $selectedCountries;
  30.     private Collection $selectedSellers;
  31.     private Collection $sellersCRFQ;
  32.     private Collection $attachments;
  33.     public function __construct()
  34.     {
  35.         $this->attachments = new ArrayCollection();
  36.         $this->sellersCRFQ = new ArrayCollection();
  37.         $this->selectedSellers = new ArrayCollection();
  38.         $this->selectedCountries = new ArrayCollection();
  39.     }
  40.     public function getId(): ?int
  41.     {
  42.         return $this->id;
  43.     }
  44.     public function getQuantity(): ?int
  45.     {
  46.         return $this->quantity;
  47.     }
  48.     public function setQuantity(?int $quantity): void
  49.     {
  50.         $this->quantity $quantity;
  51.     }
  52.     public function getBuyer(): ?OrganizationInterface
  53.     {
  54.         return $this->buyer;
  55.     }
  56.     public function setBuyer(OrganizationInterface $buyer): void
  57.     {
  58.         $this->buyer $buyer;
  59.     }
  60.     public function getCategory(): ?TaxonInterface
  61.     {
  62.         return $this->category;
  63.     }
  64.     public function setCategory(TaxonInterface $category): void
  65.     {
  66.         $this->category $category;
  67.     }
  68.     public function getCountry(): ?CountryInterface
  69.     {
  70.         return $this->country;
  71.     }
  72.     public function setCountry(CountryInterface $country): void
  73.     {
  74.         $this->country $country;
  75.     }
  76.     public function getApprovalStatus(): ?string
  77.     {
  78.         return $this->approvalStatus;
  79.     }
  80.     public function setApprovalStatus(?string $approvalStatus): void
  81.     {
  82.         $this->approvalStatus $approvalStatus;
  83.     }
  84.     public function getDetails(): ?string
  85.     {
  86.         return $this->details;
  87.     }
  88.     public function setDetails(?string $details): void
  89.     {
  90.         $this->details $details;
  91.     }
  92.     public function getRevisionReason(): ?string
  93.     {
  94.         return $this->revisionReason;
  95.     }
  96.     public function setRevisionReason(?string $revisionReason): void
  97.     {
  98.         $this->revisionReason $revisionReason;
  99.     }
  100.     public function getRejectedReason(): ?string
  101.     {
  102.         return $this->rejectedReason;
  103.     }
  104.     public function setRejectedReason(?string $rejectedReason): void
  105.     {
  106.         $this->rejectedReason $rejectedReason;
  107.     }
  108.     public function getSubject(): ?string
  109.     {
  110.         return $this->subject;
  111.     }
  112.     public function setSubject(?string $subject): void
  113.     {
  114.         $this->subject $subject;
  115.     }
  116.     public function getAttachments(): Collection
  117.     {
  118.         return $this->attachments;
  119.     }
  120.     public function addAttachment(CRFQAttachmentInterface $attachment): void
  121.     {
  122.         if (!$this->hasAttachment($attachment)) {
  123.             $this->attachments->add($attachment);
  124.         }
  125.     }
  126.     public function removeAttachment(CRFQAttachmentInterface $attachment): void
  127.     {
  128.         if ($this->hasAttachment($attachment)) {
  129.             $this->attachments->removeElement($attachment);
  130.         }
  131.     }
  132.     public function hasAttachment(CRFQAttachmentInterface $attachment): bool
  133.     {
  134.         return $this->attachments->contains($attachment);
  135.     }
  136.     public function getSelectedCountries(): Collection
  137.     {
  138.         return $this->selectedCountries;
  139.     }
  140.     public function addSelectedCountry(CountryInterface $country): void
  141.     {
  142.         if (!$this->hasSelectedCountry($country)) {
  143.             $this->selectedCountries->add($country);
  144.         }
  145.     }
  146.     public function removeSelectedCountry(CountryInterface $country): void
  147.     {
  148.         if ($this->hasSelectedCountry($country)) {
  149.             $this->selectedCountries->removeElement($country);
  150.         }
  151.     }
  152.     public function hasSelectedCountry(CountryInterface $country): bool
  153.     {
  154.         return $this->selectedCountries->contains($country);
  155.     }
  156.     public function getSelectedSellers(): Collection
  157.     {
  158.         return $this->selectedSellers;
  159.     }
  160.     public function addSelectedSeller(OrganizationInterface $seller): void
  161.     {
  162.         if (!$this->hasSelectedSeller($seller)) {
  163.             $this->selectedSellers->add($seller);
  164.         }
  165.     }
  166.     public function removeSelectedSeller(OrganizationInterface $seller): void
  167.     {
  168.         if ($this->hasSelectedSeller($seller)) {
  169.             $this->selectedSellers->removeElement($seller);
  170.         }
  171.     }
  172.     public function hasSelectedSeller(OrganizationInterface $seller): bool
  173.     {
  174.         return $this->selectedSellers->contains($seller);
  175.     }
  176.     public function getSellersCRFQ(): Collection
  177.     {
  178.         return $this->sellersCRFQ;
  179.     }
  180.     public function addSellerCRFQ(SellerCRFQInterface $sellerCRFQ): void
  181.     {
  182.         if (!$this->hasSellerCRFQ($sellerCRFQ)) {
  183.             $this->sellersCRFQ->add($sellerCRFQ);
  184.         }
  185.     }
  186.     public function removeSellerCRFQ(SellerCRFQInterface $sellerCRFQ): void
  187.     {
  188.         if ($this->hasSellerCRFQ($sellerCRFQ)) {
  189.             $this->sellersCRFQ->removeElement($sellerCRFQ);
  190.         }
  191.     }
  192.     public function hasSellerCRFQ(SellerCRFQInterface $sellerCRFQ): bool
  193.     {
  194.         return $this->sellersCRFQ->contains($sellerCRFQ);
  195.     }
  196.     public function getDeliveryDate(): ?DateTimeInterface
  197.     {
  198.         return $this->deliveryDate;
  199.     }
  200.     public function setDeliveryDate(?DateTimeInterface $deliveryDate): void
  201.     {
  202.         $this->deliveryDate $deliveryDate;
  203.     }
  204.     public function getOfferDeliveryDate(): ?DateTimeInterface
  205.     {
  206.         return $this->offerDeliveryDate;
  207.     }
  208.     public function setOfferDeliveryDate(?DateTimeInterface $offerDeliveryDate): void
  209.     {
  210.         $this->offerDeliveryDate $offerDeliveryDate;
  211.     }
  212.     public function getRevisionDate(): ?DateTimeInterface
  213.     {
  214.         return $this->revisionDate;
  215.     }
  216.     public function setRevisionDate(?DateTimeInterface $revisionDate): void
  217.     {
  218.         $this->revisionDate $revisionDate;
  219.     }
  220.     public function getRejectedDate(): ?DateTimeInterface
  221.     {
  222.         return $this->rejectedDate;
  223.     }
  224.     public function setRejectedDate(?DateTimeInterface $rejectedDate): void
  225.     {
  226.         $this->rejectedDate $rejectedDate;
  227.     }
  228. }