src/Entity/Offer.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\OfferRepository")
  9.  */
  10. class Offer
  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="offers")
  21.      * @ORM\JoinColumn(nullable=false)
  22.      */
  23.     private $supplier;
  24.     /**
  25.      * @ORM\ManyToOne(targetEntity="App\Entity\Inquiry", inversedBy="offers")
  26.      * @ORM\JoinColumn(nullable=false)
  27.      */
  28.     private $inquiry;
  29.     /**
  30.      * @ORM\Column(type="float")
  31.      */
  32.     private $retailPrice 0;
  33.     /**
  34.      * @ORM\Column(type="float")
  35.      */
  36.     private $discount 0;
  37.     /**
  38.      * @ORM\Column(type="float")
  39.      */
  40.     private $deliveryPrice 0;
  41.     /**
  42.      * @ORM\Column(type="float")
  43.      */
  44.     private $totalPrice 0;
  45.     /**
  46.      * @ORM\Column(type="string", length=32)
  47.      */
  48.     private $status 'new';
  49.     /**
  50.      * @ORM\Column(type="boolean")
  51.      */
  52.     private $chosen false;
  53.     /**
  54.      * @ORM\Column(type="float")
  55.      */
  56.     private $priceAfterDiscount 0;
  57.     /**
  58.      * @ORM\Column(type="text", nullable=true)
  59.      */
  60.     private $notices;
  61.     /**
  62.      * @ORM\Column(type="text", nullable=true)
  63.      */
  64.     private $comment;
  65.     /**
  66.      * @ORM\Column(type="boolean")
  67.      */
  68.     private $isRejected false;
  69.     /**
  70.      * @ORM\Column(type="string", length=32)
  71.      */
  72.     private $state;
  73.     /**
  74.      * @ORM\Column(type="string", length=32)
  75.      */
  76.     private $paymentMethod;
  77.     /**
  78.      * @ORM\Column(type="datetime", nullable=true)
  79.      */
  80.     private $chooseDate;
  81.     /**
  82.      * @ORM\OneToMany(targetEntity="App\Entity\PrivateMessage", mappedBy="offer")
  83.      */
  84.     private $privateMessages;
  85.     /**
  86.      * @ORM\OneToMany(targetEntity="App\Entity\OfferFile", mappedBy="offer", cascade={"persist"})
  87.      */
  88.     private $offerFiles;
  89.     /**
  90.      * @ORM\Column(type="datetime", nullable=true)
  91.      */
  92.     private $deliveryTime;
  93.     /**
  94.      * @ORM\Column(type="boolean", nullable=false, options={"default" : false})
  95.      */
  96.     private $partsOrdered 0;
  97.     /**
  98.      * @ORM\Column(type="string", nullable=true)
  99.      */
  100.     private $fileUploadId;
  101.     /**
  102.      * @ORM\Column(name="ordered_date", type="datetime", nullable=true)
  103.      */
  104.     private $orderedDate;
  105.     /**
  106.      * @ORM\OneToOne(targetEntity="App\Entity\OfferFile", cascade={"persist"})
  107.      */
  108.     private $invoiceFile;
  109.     /**
  110.      * @ORM\Column(type="boolean", options={"default": false})
  111.      */
  112.     private $requestInvoice;
  113.     /**
  114.      * @ORM\Column(name="send_date", type="datetime", nullable=true)
  115.      */
  116.     private $sendDate;
  117.     /**
  118.      * @ORM\Column(type="boolean", nullable=false, options={"default" : false})
  119.      */
  120.     private $partsSended 0;
  121.     /**
  122.     * @ORM\Column(type="string", nullable=true)
  123.     */
  124.     private $orderMode;
  125.     /**
  126.      * @ORM\Column(type="boolean")
  127.      */
  128.     private $seenByRecipient false;
  129.     /**
  130.      * @ORM\ManyToOne(targetEntity="App\Entity\ContactPerson")
  131.      * @ORM\JoinColumn(nullable=true)
  132.      */
  133.     private $contactPerson;
  134.     public function __construct()
  135.     {
  136.         $this->privateMessages = new ArrayCollection();
  137.         $this->offerFiles = new ArrayCollection();
  138.         $this->fileUploadId uniqid('offer_');
  139.     }
  140.     public function getId(): ?int
  141.     {
  142.         return $this->id;
  143.     }
  144.     public function getSupplier(): ?Customer
  145.     {
  146.         return $this->supplier;
  147.     }
  148.     public function setSupplier(?Customer $supplier): self
  149.     {
  150.         $this->supplier $supplier;
  151.         return $this;
  152.     }
  153.     public function getInquiry(): ?Inquiry
  154.     {
  155.         return $this->inquiry;
  156.     }
  157.     public function setInquiry(?Inquiry $inquiry): self
  158.     {
  159.         $this->inquiry $inquiry;
  160.         return $this;
  161.     }
  162.     public function getRetailPrice(): ?float
  163.     {
  164.         return $this->retailPrice;
  165.     }
  166.     public function setRetailPrice(float $retailPrice): self
  167.     {
  168.         $this->retailPrice $retailPrice;
  169.         return $this;
  170.     }
  171.     public function getDiscount(): ?float
  172.     {
  173.         return $this->discount;
  174.     }
  175.     public function setDiscount(float $discount): self
  176.     {
  177.         $this->discount $discount;
  178.         return $this;
  179.     }
  180.     public function getDeliveryPrice(): ?float
  181.     {
  182.         return $this->deliveryPrice;
  183.     }
  184.     public function setDeliveryPrice(float $deliveryPrice): self
  185.     {
  186.         $this->deliveryPrice $deliveryPrice;
  187.         return $this;
  188.     }
  189.     public function getTotalPrice(): ?float
  190.     {
  191.         return $this->totalPrice;
  192.     }
  193.     public function setTotalPrice(float $totalPrice): self
  194.     {
  195.         $this->totalPrice $totalPrice;
  196.         return $this;
  197.     }
  198.     public function getStatus(): ?string
  199.     {
  200.         return $this->status;
  201.     }
  202.     public function setStatus(string $status): self
  203.     {
  204.         $this->status $status;
  205.         return $this;
  206.     }
  207.     public function getChosen(): ?bool
  208.     {
  209.         return $this->chosen;
  210.     }
  211.     public function setChosen(bool $chosen): self
  212.     {
  213.         $this->chosen $chosen;
  214.         return $this;
  215.     }
  216.     public function getPriceAfterDiscount(): ?float
  217.     {
  218.         return $this->priceAfterDiscount;
  219.     }
  220.     public function setPriceAfterDiscount(float $priceAfterDiscount): self
  221.     {
  222.         $this->priceAfterDiscount $priceAfterDiscount;
  223.         return $this;
  224.     }
  225.     public function getNotices(): ?string
  226.     {
  227.         return $this->notices;
  228.     }
  229.     public function setNotices(?string $notices): self
  230.     {
  231.         $this->notices $notices;
  232.         return $this;
  233.     }
  234.     public function getComment(): ?string
  235.     {
  236.         return $this->comment;
  237.     }
  238.     public function setComment(?string $comment): self
  239.     {
  240.         $this->comment $comment;
  241.         return $this;
  242.     }
  243.     public function getIsRejected(): ?bool
  244.     {
  245.         return $this->isRejected;
  246.     }
  247.     public function setIsRejected(bool $isRejected): self
  248.     {
  249.         $this->isRejected $isRejected;
  250.         return $this;
  251.     }
  252.     public function getState(): ?string
  253.     {
  254.         return $this->state;
  255.     }
  256.     public function setState(string $state): self
  257.     {
  258.         $this->state $state;
  259.         return $this;
  260.     }
  261.     public function getPaymentMethod(): ?string
  262.     {
  263.         return $this->paymentMethod;
  264.     }
  265.     public function setPaymentMethod(string $paymentMethod): self
  266.     {
  267.         $this->paymentMethod $paymentMethod;
  268.         return $this;
  269.     }
  270.     public function getChooseDate(): ?\DateTimeInterface
  271.     {
  272.         return $this->chooseDate;
  273.     }
  274.     public function setChooseDate(?\DateTimeInterface $chooseDate): self
  275.     {
  276.         $this->chooseDate $chooseDate;
  277.         return $this;
  278.     }
  279.     /**
  280.      * @return Collection|PrivateMessage[]
  281.      */
  282.     public function getPrivateMessages(): Collection
  283.     {
  284.         return $this->privateMessages;
  285.     }
  286.     public function addPrivateMessage(PrivateMessage $privateMessage): self
  287.     {
  288.         if (!$this->privateMessages->contains($privateMessage)) {
  289.             $this->privateMessages[] = $privateMessage;
  290.             $privateMessage->setOffer($this);
  291.         }
  292.         return $this;
  293.     }
  294.     public function removePrivateMessage(PrivateMessage $privateMessage): self
  295.     {
  296.         if ($this->privateMessages->contains($privateMessage)) {
  297.             $this->privateMessages->removeElement($privateMessage);
  298.             // set the owning side to null (unless already changed)
  299.             if ($privateMessage->getOffer() === $this) {
  300.                 $privateMessage->setOffer(null);
  301.             }
  302.         }
  303.         return $this;
  304.     }
  305.     public function __toString()
  306.     {
  307.         return (string)$this->getId();
  308.     }
  309.     /**
  310.      * @return Collection|OfferFile[]
  311.      */
  312.     public function getOfferFiles(): Collection
  313.     {
  314.         return $this->offerFiles;
  315.     }
  316.     public function setOfferFiles(ArrayCollection $inquiryFiles) : self
  317.     {
  318.         $this->offerFiles $inquiryFiles;
  319.         return $this;
  320.     }
  321.     public function addOfferFile($offerFile): self
  322.     {
  323.         if (!$this->offerFiles->contains($offerFile)) {
  324.             $this->offerFiles[] = $offerFile;
  325.             if ($offerFile instanceof OfferFile) {
  326.                 $offerFile->setOffer($this);
  327.             }
  328.         }
  329.         return $this;
  330.     }
  331.     public function removeOfferFile($offerFile): self
  332.     {
  333.         /** @var OfferFile $offerFile */
  334.         if ($this->offerFiles->contains($offerFile)) {
  335.             $this->offerFiles->removeElement($offerFile);
  336.             // set the owning side to null (unless already changed)
  337.             if ($offerFile->getOffer() === $this) {
  338.                 $offerFile->setOffer(null);
  339.             }
  340.         }
  341.         return $this;
  342.     }
  343.     public function getDeliveryTime(): ?\DateTimeInterface
  344.     {
  345.         return $this->deliveryTime;
  346.     }
  347.     public function setDeliveryTime(?\DateTimeInterface $deliveryTime): self
  348.     {
  349.         $this->deliveryTime $deliveryTime;
  350.         return $this;
  351.     }
  352.     public function getPartsOrdered()
  353.     {
  354.         return $this->partsOrdered;
  355.     }
  356.     public function setPartsOrdered($partsOrdered)
  357.     {
  358.         $this->partsOrdered $partsOrdered;
  359.     }
  360.     /**
  361.      * @return mixed
  362.      */
  363.     public function getFileUploadId()
  364.     {
  365.         return $this->fileUploadId;
  366.     }
  367.     /**
  368.      * @param mixed $fileUploadId
  369.      */
  370.     public function setFileUploadId($fileUploadId)
  371.     {
  372.         $this->fileUploadId $fileUploadId;
  373.     }
  374.     /**
  375.      * @return mixed
  376.      */
  377.     public function getOrderedDate()
  378.     {
  379.         return $this->orderedDate;
  380.     }
  381.     /**
  382.      * @param mixed $orderedDate
  383.      */
  384.     public function setOrderedDate($orderedDate): void
  385.     {
  386.         $this->orderedDate $orderedDate;
  387.     }
  388.     /**
  389.      * @return mixed
  390.      */
  391.     public function getInvoiceFile()
  392.     {
  393.         return $this->invoiceFile;
  394.     }
  395.     /**
  396.      * @param mixed $invoiceFile
  397.      */
  398.     public function setInvoiceFile($invoiceFile): void
  399.     {
  400.         $this->invoiceFile $invoiceFile;
  401.     }
  402.     /**
  403.      * @return mixed
  404.      */
  405.     public function getRequestInvoice()
  406.     {
  407.         return $this->requestInvoice;
  408.     }
  409.     /**
  410.      * @param mixed $requestInvoice
  411.      */
  412.     public function setRequestInvoice($requestInvoice): void
  413.     {
  414.         $this->requestInvoice $requestInvoice;
  415.     }
  416.     /**
  417.      * @return mixed
  418.      */
  419.     public function getSendDate()
  420.     {
  421.         return $this->sendDate;
  422.     }
  423.     /**
  424.      * @param mixed $sendDate
  425.      */
  426.     public function setSendDate($sendDate)
  427.     {
  428.         $this->sendDate $sendDate;
  429.     }
  430.     /**
  431.      * @return int
  432.      */
  433.     public function getPartsSended()
  434.     {
  435.         return $this->partsSended;
  436.     }
  437.     /**
  438.      * @param int $partsSended
  439.      */
  440.     public function setPartsSended(int $partsSended)
  441.     {
  442.         $this->partsSended $partsSended;
  443.     }
  444.     /**
  445.      * @return mixed
  446.      */
  447.     public function getOrderMode()
  448.     {
  449.         return $this->orderMode;
  450.     }
  451.     /**
  452.      * @param mixed $orderMode
  453.      */
  454.     public function setOrderMode($orderMode): void
  455.     {
  456.         $this->orderMode $orderMode;
  457.     }
  458.     /**
  459.      * @return mixed
  460.      */
  461.     public function getContactPerson()
  462.     {
  463.         return $this->contactPerson;
  464.     }
  465.     /**
  466.      * @param mixed $contactPerson
  467.      */
  468.     public function setContactPerson($contactPerson): void
  469.     {
  470.         $this->contactPerson $contactPerson;
  471.     }
  472.     /**
  473.      * @return bool
  474.      */
  475.     public function isSeenByRecipient(): bool
  476.     {
  477.         return $this->seenByRecipient;
  478.     }
  479.     /**
  480.      * @param bool $seenByRecipient
  481.      */
  482.     public function setSeenByRecipient(bool $seenByRecipient): void
  483.     {
  484.         $this->seenByRecipient $seenByRecipient;
  485.     }
  486. }