src/Entity/Inquiry.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Utils\ExtendedEntity;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8.  * @ORM\Entity(repositoryClass="App\Repository\InquiryRepository")
  9.  */
  10. class Inquiry
  11. {
  12.     use ExtendedEntity;
  13.     /**
  14.      * @ORM\Id()
  15.      * @ORM\GeneratedValue()
  16.      * @ORM\Column(type="integer")
  17.      */
  18.     private $id;
  19.     /**
  20.      * @ORM\ManyToOne(targetEntity="App\Entity\Customer", inversedBy="inquiries")
  21.      * @ORM\JoinColumn(nullable=false)
  22.      */
  23.     private $recipient;
  24.     /**
  25.      * @ORM\ManyToOne(targetEntity="App\Entity\CustomerInvoiceAddress", inversedBy="inquiries")
  26.      * @ORM\JoinColumn(nullable=true)
  27.      */
  28.     private $invoiceAddress;
  29.     /**
  30.      * @ORM\Column(type="datetime")
  31.      */
  32.     private $expirationDate;
  33.     /**
  34.      * @ORM\Column(type="string", length=128)
  35.      */
  36.     private $status 'new';
  37.     /**
  38.      * @ORM\OneToMany(targetEntity="App\Entity\Offer", mappedBy="inquiry")
  39.      */
  40.     private $offers;
  41.     /**
  42.      * @ORM\OneToMany(targetEntity="App\Entity\InquiryDiscussionEntry", mappedBy="inquiry")
  43.      */
  44.     private $inquiryDiscussionEntries;
  45.     /**
  46.      * @ORM\Column(type="string", length=17)
  47.      */
  48.     private $vin;
  49.     /**
  50.      * @ORM\Column(type="string", length=64)
  51.      */
  52.     private $model;
  53.     /**
  54.      * @ORM\Column(type="string", length=8)
  55.      */
  56.     private $registrationNumber;
  57.     /**
  58.      * @ORM\Column(type="text", nullable=true)
  59.      */
  60.     private $notices;
  61.     /**
  62.      * @ORM\OneToMany(targetEntity="App\Entity\InquiryFile", mappedBy="inquiry", cascade={"persist"})
  63.      */
  64.     private $inquiryFiles;
  65.     /**
  66.      * @ORM\OneToOne(targetEntity="App\Entity\InquiryFile", cascade={"persist", "remove"})
  67.      */
  68.     private $vinPhoto;
  69.     /**
  70.      * @ORM\OneToOne(targetEntity="App\Entity\InquiryFile", cascade={"persist", "remove"})
  71.      */
  72.     private $estimateFile;
  73.     /**
  74.      * @ORM\Column(type="boolean")
  75.      */
  76.     private $archived false;
  77.     /**
  78.      * @ORM\ManyToOne(targetEntity="App\Entity\Make")
  79.      * @ORM\JoinColumn(nullable=false)
  80.      */
  81.     private $make;
  82.     /**
  83.      * @ORM\Column(type="string", nullable=true)
  84.      */
  85.     private $fileUploadId;
  86.     /**
  87.      * @ORM\Column(type="text", nullable=true)
  88.      */
  89.     private $noticesFV;
  90.     /**
  91.      * @ORM\ManyToOne(targetEntity="App\Entity\CustomerAddress")
  92.      * @ORM\JoinColumn(nullable=true)
  93.      */
  94.     private $customerAddress;
  95.     /**
  96.      * @ORM\ManyToMany(targetEntity="App\Entity\Customer", orphanRemoval=true, inversedBy="choosedForInquiries")
  97.      */
  98.     private $choosedSuppliers;
  99.     /**
  100.      * @ORM\Column(type="datetime", nullable=true)
  101.      */
  102.     private $partsReceivedDate;
  103.     /**
  104.      * @ORM\Column(type="datetime", nullable=true)
  105.      */
  106.     private $partsIssuedDate;
  107.     /**
  108.      * @ORM\Column(type="boolean", options={"default": false})
  109.      */
  110.     private $isPartsReceived;
  111.     /**
  112.      * @ORM\Column(type="boolean", options={"default": false})
  113.      */
  114.     private $isPartsIssued;
  115.     /**
  116.      * @ORM\OneToMany(targetEntity="App\Entity\InquirySupplier", mappedBy="inquiry")
  117.      */
  118.     private $inquirySuppliers;
  119.     /**
  120.      * @ORM\Column(type="string", length=128, nullable=true)
  121.      */
  122.     private $buyerStatus null;
  123.     /**
  124.      * @ORM\Column(type="string", length=128, nullable=true)
  125.      */
  126.     private $sellerStatus null;
  127.     /**
  128.      * @ORM\OneToMany(targetEntity="App\Entity\PrivateMessage", mappedBy="inquiry")
  129.      */
  130.     private $privateMessages;
  131.     /**
  132.      * @ORM\ManyToOne(targetEntity="App\Entity\ContactPerson")
  133.      * @ORM\JoinColumn(nullable=true)
  134.      */
  135.     private $contactPerson;
  136.     public function __construct()
  137.     {
  138.         $this->offers = new ArrayCollection();
  139.         $this->inquiryDiscussionEntries = new ArrayCollection();
  140.         $this->inquiryFiles = new ArrayCollection();
  141.         $this->choosedSuppliers = new ArrayCollection();
  142.         $this->fileUploadId uniqid('inquiry_');
  143.         $this->isPartsIssued false;
  144.         $this->isPartsReceived false;
  145.         $this->inquirySuppliers = new ArrayCollection();
  146.         $this->privateMessages = new ArrayCollection();
  147.     }
  148.     public function getId(): ?int
  149.     {
  150.         return $this->id;
  151.     }
  152.     public function setId($id): void
  153.     {
  154.         $this->id $id;
  155.     }
  156.     public function getRecipient(): ?Customer
  157.     {
  158.         return $this->recipient;
  159.     }
  160.     public function setRecipient(?Customer $recipient): self
  161.     {
  162.         $this->recipient $recipient;
  163.         return $this;
  164.     }
  165.     public function getExpirationDate(): ?\DateTimeInterface
  166.     {
  167.         return $this->expirationDate;
  168.     }
  169.     public function setExpirationDate(?\DateTimeInterface $expirationDate): self
  170.     {
  171.         if ($expirationDate !== null) {
  172.             $this->expirationDate = clone $expirationDate;
  173.         } else {
  174.             $this->expirationDate $expirationDate;
  175.         }
  176.         return $this;
  177.     }
  178.     public function getStatus(): ?string
  179.     {
  180.         return $this->status;
  181.     }
  182.     public function setStatus(string $status): self
  183.     {
  184.         $this->status $status;
  185.         return $this;
  186.     }
  187.     /**
  188.      * @return Collection|Offer[]
  189.      */
  190.     public function getOffers(): Collection
  191.     {
  192.         return $this->offers;
  193.     }
  194.     public function addOffer(Offer $offer): self
  195.     {
  196.         if (!$this->offers->contains($offer)) {
  197.             $this->offers[] = $offer;
  198.             $offer->setInquiry($this);
  199.         }
  200.         return $this;
  201.     }
  202.     public function removeOffer(Offer $offer): self
  203.     {
  204.         if ($this->offers->contains($offer)) {
  205.             $this->offers->removeElement($offer);
  206.             // set the owning side to null (unless already changed)
  207.             if ($offer->getInquiry() === $this) {
  208.                 $offer->setInquiry(null);
  209.             }
  210.         }
  211.         return $this;
  212.     }
  213.     public function setOffers($offers)
  214.     {
  215.         $this->offers $offers;
  216.     }
  217.     /**
  218.      * @return Collection|InquiryDiscussionEntry[]
  219.      */
  220.     public function getInquiryDiscussionEntries(): Collection
  221.     {
  222.         return $this->inquiryDiscussionEntries;
  223.     }
  224.     public function addInquiryDiscussionEntry(InquiryDiscussionEntry $inquiryDiscussionEntry): self
  225.     {
  226.         if (!$this->inquiryDiscussionEntries->contains($inquiryDiscussionEntry)) {
  227.             $this->inquiryDiscussionEntries[] = $inquiryDiscussionEntry;
  228.             $inquiryDiscussionEntry->setInquiry($this);
  229.         }
  230.         return $this;
  231.     }
  232.     public function removeInquiryDiscussionEntry(InquiryDiscussionEntry $inquiryDiscussionEntry): self
  233.     {
  234.         if ($this->inquiryDiscussionEntries->contains($inquiryDiscussionEntry)) {
  235.             $this->inquiryDiscussionEntries->removeElement($inquiryDiscussionEntry);
  236.             // set the owning side to null (unless already changed)
  237.             if ($inquiryDiscussionEntry->getInquiry() === $this) {
  238.                 $inquiryDiscussionEntry->setInquiry(null);
  239.             }
  240.         }
  241.         return $this;
  242.     }
  243.     public function setInquiryDiscussionEntries($discussionEntries)
  244.     {
  245.         $this->inquiryDiscussionEntries $discussionEntries;
  246.     }
  247.     public function getVin(): ?string
  248.     {
  249.         return $this->vin;
  250.     }
  251.     public function setVin(?string $vin): self
  252.     {
  253.         $this->vin $vin;
  254.         return $this;
  255.     }
  256.     public function getModel(): ?string
  257.     {
  258.         return $this->model;
  259.     }
  260.     public function setModel(string $model): self
  261.     {
  262.         $this->model $model;
  263.         return $this;
  264.     }
  265.     public function getRegistrationNumber(): ?string
  266.     {
  267.         return $this->registrationNumber;
  268.     }
  269.     public function setRegistrationNumber(string $registrationNumber): self
  270.     {
  271.         $this->registrationNumber $registrationNumber;
  272.         return $this;
  273.     }
  274.     public function getNotices(): ?string
  275.     {
  276.         return $this->notices;
  277.     }
  278.     public function setNotices(?string $notices): self
  279.     {
  280.         $this->notices $notices;
  281.         return $this;
  282.     }
  283.     /**
  284.      * @return Collection|InquiryFile[]
  285.      */
  286.     public function getInquiryFiles(): Collection
  287.     {
  288.         return $this->inquiryFiles;
  289.     }
  290.     public function setInquiryFiles(ArrayCollection $inquiryFiles) : self
  291.     {
  292.         $this->inquiryFiles $inquiryFiles;
  293.         return $this;
  294.     }
  295.     public function addInquiryFile($inquiryFile): self
  296.     {
  297.         /** @var InquiryFile $inquiryFile */
  298.         if (!$this->inquiryFiles->contains($inquiryFile)) {
  299.             $this->inquiryFiles[] = $inquiryFile;
  300.             if ($inquiryFile instanceof InquiryFile) {
  301.                 $inquiryFile->setInquiry($this);
  302.             }
  303.         }
  304.         return $this;
  305.     }
  306.     public function removeInquiryFile($inquiryFile): self
  307.     {
  308.         /** @var InquiryFile $inquiryFile */
  309.         if ($this->inquiryFiles->contains($inquiryFile)) {
  310.             $this->inquiryFiles->removeElement($inquiryFile);
  311.             // set the owning side to null (unless already changed)
  312.             if ($inquiryFile->getInquiry() === $this) {
  313.                 $inquiryFile->setInquiry(null);
  314.             }
  315.         }
  316.         return $this;
  317.     }
  318.     public function getVinPhoto()
  319.     {
  320.         return $this->vinPhoto;
  321.     }
  322.     public function setVinPhoto($vinPhoto): self
  323.     {
  324.         $this->vinPhoto $vinPhoto;
  325.         return $this;
  326.     }
  327.     public function getEstimateFile()
  328.     {
  329.         return $this->estimateFile;
  330.     }
  331.     public function setEstimateFile($estimateFile): self
  332.     {
  333.         $this->estimateFile $estimateFile;
  334.         return $this;
  335.     }
  336.     public function getArchived(): ?bool
  337.     {
  338.         return $this->archived;
  339.     }
  340.     public function setArchived(bool $archived): self
  341.     {
  342.         $this->archived $archived;
  343.         return $this;
  344.     }
  345.     public function getMake(): ?Make
  346.     {
  347.         return $this->make;
  348.     }
  349.     public function setMake(?Make $make): self
  350.     {
  351.         $this->make $make;
  352.         return $this;
  353.     }
  354.     public function getFileUploadId()
  355.     {
  356.         return $this->fileUploadId;
  357.     }
  358.     public function setFileUploadId($fileUploadId)
  359.     {
  360.         $this->fileUploadId $fileUploadId;
  361.     }
  362.     /**
  363.      * @return bool
  364.      */
  365.     public function getActive()
  366.     {
  367.         return $this->active;
  368.     }
  369.     /**
  370.      * @param bool $active
  371.      */
  372.     public function setActive(bool $active)
  373.     {
  374.         $this->active $active;
  375.     }
  376.     /**
  377.      * @return mixed
  378.      */
  379.     public function getNoticesFV()
  380.     {
  381.         return $this->noticesFV;
  382.     }
  383.     /**
  384.      * @param mixed $noticesFV
  385.      * @return Inquiry
  386.      */
  387.     public function setNoticesFV($noticesFV)
  388.     {
  389.         $this->noticesFV $noticesFV;
  390.         return $this;
  391.     }
  392.     public function getCustomerAddress(): ?CustomerAddress
  393.     {
  394.         return $this->customerAddress;
  395.     }
  396.     public function setCustomerAddress(?CustomerAddress $customerAddress): self
  397.     {
  398.         $this->customerAddress $customerAddress;
  399.         return $this;
  400.     }
  401.     /**
  402.      * @return Collection|Customer[]
  403.      */
  404.     public function getChoosedSuppliers(): Collection
  405.     {
  406.         return $this->choosedSuppliers;
  407.     }
  408.     public function addChoosedSupplier(Customer $choosedSupplier): self
  409.     {
  410.         if (!$this->choosedSuppliers->contains($choosedSupplier)) {
  411.             $this->choosedSuppliers[] = $choosedSupplier;
  412.         }
  413.         return $this;
  414.     }
  415.     public function removeChoosedSupplier(Customer $choosedSupplier): self
  416.     {
  417.         if ($this->choosedSuppliers->contains($choosedSupplier)) {
  418.             $this->choosedSuppliers->removeElement($choosedSupplier);
  419.         }
  420.         return $this;
  421.     }
  422.     public function getPartsReceivedDate(): ?\DateTimeInterface
  423.     {
  424.         return $this->partsReceivedDate;
  425.     }
  426.     public function setPartsReceivedDate(?\DateTimeInterface $partsReceivedDate): self
  427.     {
  428.         $this->partsReceivedDate $partsReceivedDate;
  429.         return $this;
  430.     }
  431.     public function getPartsIssuedDate(): ?\DateTimeInterface
  432.     {
  433.         return $this->partsIssuedDate;
  434.     }
  435.     public function setPartsIssuedDate(?\DateTimeInterface $partsIssuedDate): self
  436.     {
  437.         $this->partsIssuedDate $partsIssuedDate;
  438.         return $this;
  439.     }
  440.     public function getIsPartsReceived(): ?bool
  441.     {
  442.         return $this->isPartsReceived;
  443.     }
  444.     public function setIsPartsReceived(bool $isPartsReceived): self
  445.     {
  446.         $this->isPartsReceived $isPartsReceived;
  447.         return $this;
  448.     }
  449.     public function getIsPartsIssued(): ?bool
  450.     {
  451.         return $this->isPartsIssued;
  452.     }
  453.     public function setIsPartsIssued(bool $isPartsIssued): self
  454.     {
  455.         $this->isPartsIssued $isPartsIssued;
  456.         return $this;
  457.     }
  458.     /**
  459.      * @return Collection|InquirySupplier[]
  460.      */
  461.     public function getInquirySuppliers(): Collection
  462.     {
  463.         return $this->inquirySuppliers;
  464.     }
  465.     public function addInquirySupplier(InquirySupplier $inquirySupplier): self
  466.     {
  467.         if (!$this->inquirySuppliers->contains($inquirySupplier)) {
  468.             $this->inquirySuppliers[] = $inquirySupplier;
  469.             $inquirySupplier->setInquiry($this);
  470.         }
  471.         return $this;
  472.     }
  473.     public function removeInquirySupplier(InquirySupplier $inquirySupplier): self
  474.     {
  475.         if ($this->inquirySuppliers->contains($inquirySupplier)) {
  476.             $this->inquirySuppliers->removeElement($inquirySupplier);
  477.             // set the owning side to null (unless already changed)
  478.             if ($inquirySupplier->getInquiry() === $this) {
  479.                 $inquirySupplier->setInquiry(null);
  480.             }
  481.         }
  482.         return $this;
  483.     }
  484.     public function getBuyerStatus()
  485.     {
  486.         return $this->buyerStatus;
  487.     }
  488.     public function setBuyerStatus($buyerStatus): void
  489.     {
  490.         $this->buyerStatus $buyerStatus;
  491.     }
  492.     /**
  493.      * @return null
  494.      */
  495.     public function getSellerStatus()
  496.     {
  497.         return $this->sellerStatus;
  498.     }
  499.     /**
  500.      * @param null $sellerStatus
  501.      */
  502.     public function setSellerStatus($sellerStatus): void
  503.     {
  504.         $this->sellerStatus $sellerStatus;
  505.     }
  506.     /**
  507.      * @return Collection|PrivateMessage[]
  508.      */
  509.     public function getPrivateMessages(): Collection
  510.     {
  511.         return $this->privateMessages;
  512.     }
  513.     public function addPrivateMessage(PrivateMessage $privateMessage): self
  514.     {
  515.         if (!$this->privateMessages->contains($privateMessage)) {
  516.             $this->privateMessages[] = $privateMessage;
  517.             $privateMessage->setInquiry($this);
  518.         }
  519.         return $this;
  520.     }
  521.     public function removePrivateMessage(PrivateMessage $privateMessage): self
  522.     {
  523.         if ($this->privateMessages->contains($privateMessage)) {
  524.             $this->privateMessages->removeElement($privateMessage);
  525.             // set the owning side to null (unless already changed)
  526.             if ($privateMessage->getInquiry() === $this) {
  527.                 $privateMessage->setInquiry(null);
  528.             }
  529.         }
  530.         return $this;
  531.     }
  532.     /**
  533.      * @return mixed
  534.      */
  535.     public function getContactPerson()
  536.     {
  537.         return $this->contactPerson;
  538.     }
  539.     /**
  540.      * @param mixed $contactPerson
  541.      */
  542.     public function setContactPerson($contactPerson): void
  543.     {
  544.         $this->contactPerson $contactPerson;
  545.     }
  546.     /** @param mixed $invoiceAddress */
  547.     public function setInvoiceAddress($invoiceAddress): void
  548.     {
  549.         $this->invoiceAddress $invoiceAddress;
  550.     }
  551.     /** @return mixed */
  552.     public function getInvoiceAddress()
  553.     {
  554.         return $this->invoiceAddress;
  555.     }
  556. }