src/Entity/FenceOffer.php line 17

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\FenceOfferRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use Gedmo\Loggable\Loggable;
  8. use Gedmo\Timestampable\Traits\TimestampableEntity;
  9. use Gedmo\Mapping\Annotation as Gedmo;
  10. /**
  11.  * @ORM\Entity(repositoryClass=FenceOfferRepository::class)
  12.  * @Gedmo\Loggable
  13.  */
  14. class FenceOffer implements Loggable
  15. {
  16.     /**
  17.      * Hook timestampable behavior
  18.      * updates createdAt, updatedAt fields
  19.      */
  20.     use TimestampableEntity;
  21.     /**
  22.      * @ORM\Id
  23.      * @ORM\GeneratedValue
  24.      * @ORM\Column(type="integer")
  25.      */
  26.     private $id;
  27.     /**
  28.      * @ORM\ManyToOne(targetEntity=FenceDictionary::class, inversedBy="fenceOffers")
  29.      * @ORM\JoinColumn(nullable=false)
  30.      * @Gedmo\Versioned
  31.      */
  32.     private $fence;
  33.     /**
  34.      * @ORM\Column(type="json")
  35.      * @Gedmo\Versioned
  36.      */
  37.     private $fenceConfigurationJson = [];
  38.     /**
  39.      * @ORM\Column(type="integer", nullable=true)
  40.      * @Gedmo\Versioned
  41.      */
  42.     private $alfenOfferId;
  43.     /**
  44.      * @ORM\Column(type="text", nullable=true)
  45.      * @Gedmo\Versioned
  46.      */
  47.     private $alfenHtmlResponse;
  48.     /**
  49.      * @ORM\Column(type="float", nullable=true)
  50.      * @Gedmo\Versioned
  51.      */
  52.     private $offerNetAmount;
  53.     /**
  54.      * @ORM\Column(type="float", nullable=true)
  55.      * @Gedmo\Versioned
  56.      */
  57.     private $discountedOfferNetAmount;
  58.     /**
  59.      * @ORM\Column(type="float", nullable=true)
  60.      * @Gedmo\Versioned
  61.      */
  62.     private $netOfferTotal;
  63.     /**
  64.      * @ORM\Column(type="float", nullable=true)
  65.      * @Gedmo\Versioned
  66.      */
  67.     private $grossOfferTotal;
  68.     /**
  69.      * @ORM\Column(type="string", length=255, nullable=true)
  70.      * @Gedmo\Versioned
  71.      */
  72.     private $note;
  73.     /**
  74.      * @ORM\OneToMany(targetEntity=AdditionalOfferFee::class, mappedBy="fenceOffer")
  75.      */
  76.     private $additionalOfferFees;
  77.     /**
  78.      * @ORM\OneToMany(targetEntity=FenceFace::class, mappedBy="fenceOffer")
  79.      */
  80.     private $fenceFaces;
  81.     /**
  82.      * @ORM\OneToMany(targetEntity=File::class, mappedBy="fenceOffer")
  83.      */
  84.     private $files;
  85.     /**
  86.      * @ORM\Column(type="string", length=255, nullable=true)
  87.      * @Gedmo\Versioned
  88.      */
  89.     private $name;
  90.     /**
  91.      * @ORM\ManyToOne(targetEntity=Client::class, inversedBy="fenceOffers")
  92.      */
  93.     private $client;
  94.     /**
  95.      * @ORM\ManyToOne(targetEntity=FenceElementDictionary::class)
  96.      * @ORM\JoinColumn(nullable=false)
  97.      */
  98.     private $pole;
  99.     /**
  100.      * @ORM\Column(type="integer")
  101.      */
  102.     private $height;
  103.     /**
  104.      * @ORM\Column(type="string", length=255, nullable=true)
  105.      */
  106.     private $alfenQuotationStatus;
  107.     /**
  108.      * @ORM\Column(type="json")
  109.      */
  110.     private $quotation = [];
  111.     /**
  112.      * @ORM\Column(type="string", length=255, nullable=true)
  113.      */
  114.     private $alfenLogFileName;
  115.     /**
  116.      * @ORM\ManyToOne(targetEntity=User::class)
  117.      * @ORM\JoinColumn(nullable=false)
  118.      */
  119.     private $owner;
  120.     /**
  121.      * @ORM\ManyToOne(targetEntity=ElementSettings::class)
  122.      * @ORM\JoinColumn(nullable=false)
  123.      */
  124.     private $elementSettings;
  125.     private $copyFenceOfferId;
  126.     /**
  127.      * @ORM\Column(type="string", length=184)
  128.      */
  129.     private $orderNote;
  130.     /**
  131.      * @ORM\Column(type="json")
  132.      */
  133.     private $customPdfHeaders = [];
  134.     /**
  135.      * @ORM\ManyToOne(targetEntity=FenceColorDictionary::class)
  136.      * @ORM\JoinColumn(nullable=false)
  137.      */
  138.     private $fenceColor;
  139.     public function __construct()
  140.     {
  141.         $this->additionalOfferFees = new ArrayCollection();
  142.         $this->fenceFaces = new ArrayCollection();
  143.         $this->files = new ArrayCollection();
  144.     }
  145.     public function getId(): ?int
  146.     {
  147.         return $this->id;
  148.     }
  149.     public function getFence(): ?FenceDictionary
  150.     {
  151.         return $this->fence;
  152.     }
  153.     public function setFence(?FenceDictionary $fence): self
  154.     {
  155.         $this->fence $fence;
  156.         return $this;
  157.     }
  158.     public function getFenceConfigurationJson(): ?array
  159.     {
  160.         return $this->fenceConfigurationJson;
  161.     }
  162.     public function setFenceConfigurationJson(array $fenceConfigurationJson): self
  163.     {
  164.         $this->fenceConfigurationJson $fenceConfigurationJson;
  165.         return $this;
  166.     }
  167.     public function getAlfenOfferId(): ?int
  168.     {
  169.         return $this->alfenOfferId;
  170.     }
  171.     public function setAlfenOfferId(?int $alfenOfferId): self
  172.     {
  173.         $this->alfenOfferId $alfenOfferId;
  174.         return $this;
  175.     }
  176.     public function getAlfenHtmlResponse(): ?string
  177.     {
  178.         return $this->alfenHtmlResponse;
  179.     }
  180.     public function setAlfenHtmlResponse(string $alfenHtmlResponse): self
  181.     {
  182.         $this->alfenHtmlResponse $alfenHtmlResponse;
  183.         return $this;
  184.     }
  185.     public function getOfferNetAmount(): ?float
  186.     {
  187.         return $this->offerNetAmount;
  188.     }
  189.     public function setOfferNetAmount(float $offerNetAmount): self
  190.     {
  191.         $this->offerNetAmount $offerNetAmount;
  192.         return $this;
  193.     }
  194.     public function getDiscountedOfferNetAmount(): ?float
  195.     {
  196.         return $this->discountedOfferNetAmount;
  197.     }
  198.     public function setDiscountedOfferNetAmount(float $discountedOfferNetAmount): self
  199.     {
  200.         $this->discountedOfferNetAmount $discountedOfferNetAmount;
  201.         return $this;
  202.     }
  203.     public function getNetOfferTotal(): ?float
  204.     {
  205.         return $this->netOfferTotal;
  206.     }
  207.     public function setNetOfferTotal(float $netOfferTotal): self
  208.     {
  209.         $this->netOfferTotal $netOfferTotal;
  210.         return $this;
  211.     }
  212.     public function getGrossOfferTotal(): ?float
  213.     {
  214.         return $this->grossOfferTotal;
  215.     }
  216.     public function setGrossOfferTotal(float $grossOfferTotal): self
  217.     {
  218.         $this->grossOfferTotal $grossOfferTotal;
  219.         return $this;
  220.     }
  221.     public function getNote(): ?string
  222.     {
  223.         return $this->note;
  224.     }
  225.     public function setNote(string $note): self
  226.     {
  227.         $this->note $note;
  228.         return $this;
  229.     }
  230.     /**
  231.      * @return Collection<int, AdditionalOfferFee>
  232.      */
  233.     public function getAdditionalOfferFees(): Collection
  234.     {
  235.         return $this->additionalOfferFees;
  236.     }
  237.     public function addAdditionalOfferFee(AdditionalOfferFee $additionalOfferFee): self
  238.     {
  239.         if (!$this->additionalOfferFees->contains($additionalOfferFee)) {
  240.             $this->additionalOfferFees[] = $additionalOfferFee;
  241.             $additionalOfferFee->setFenceOffer($this);
  242.         }
  243.         return $this;
  244.     }
  245.     public function removeAdditionalOfferFee(AdditionalOfferFee $additionalOfferFee): self
  246.     {
  247.         if ($this->additionalOfferFees->removeElement($additionalOfferFee)) {
  248.             // set the owning side to null (unless already changed)
  249.             if ($additionalOfferFee->getFenceOffer() === $this) {
  250.                 $additionalOfferFee->setFenceOffer(null);
  251.             }
  252.         }
  253.         return $this;
  254.     }
  255.     /**
  256.      * @return Collection<int, FenceFace>
  257.      */
  258.     public function getFenceFaces(): Collection
  259.     {
  260.         return $this->fenceFaces;
  261.     }
  262.     public function addFenceFace(FenceFace $fenceFace): self
  263.     {
  264.         if (!$this->fenceFaces->contains($fenceFace)) {
  265.             $this->fenceFaces[] = $fenceFace;
  266.             $fenceFace->setFenceOffer($this);
  267.         }
  268.         return $this;
  269.     }
  270.     public function removeFenceFace(FenceFace $fenceFace): self
  271.     {
  272.         if ($this->fenceFaces->removeElement($fenceFace)) {
  273.             // set the owning side to null (unless already changed)
  274.             if ($fenceFace->getFenceOffer() === $this) {
  275.                 $fenceFace->setFenceOffer(null);
  276.             }
  277.         }
  278.         return $this;
  279.     }
  280.     /**
  281.      * @return Collection<int, File>
  282.      */
  283.     public function getFiles(): Collection
  284.     {
  285.         return $this->files;
  286.     }
  287.     public function addFile(File $file): self
  288.     {
  289.         if (!$this->files->contains($file)) {
  290.             $this->files[] = $file;
  291.             $file->setFenceOffer($this);
  292.         }
  293.         return $this;
  294.     }
  295.     public function removeFile(File $file): self
  296.     {
  297.         if ($this->files->removeElement($file)) {
  298.             // set the owning side to null (unless already changed)
  299.             if ($file->getFenceOffer() === $this) {
  300.                 $file->setFenceOffer(null);
  301.             }
  302.         }
  303.         return $this;
  304.     }
  305.     public function getName(): ?string
  306.     {
  307.         return $this->name;
  308.     }
  309.     public function setName(?string $name): self
  310.     {
  311.         $this->name $name;
  312.         return $this;
  313.     }
  314.     public function getClient(): ?Client
  315.     {
  316.         return $this->client;
  317.     }
  318.     public function setClient(?Client $client): self
  319.     {
  320.         $this->client $client;
  321.         return $this;
  322.     }
  323.     public function getPole(): ?FenceElementDictionary
  324.     {
  325.         return $this->pole;
  326.     }
  327.     public function setPole(?FenceElementDictionary $pole): self
  328.     {
  329.         $this->pole $pole;
  330.         return $this;
  331.     }
  332.     public function getHeight(): ?int
  333.     {
  334.         return $this->height;
  335.     }
  336.     public function setHeight(int $height): self
  337.     {
  338.         $this->height $height;
  339.         return $this;
  340.     }
  341.     public function getAlfenQuotationStatus(): ?string
  342.     {
  343.         return $this->alfenQuotationStatus;
  344.     }
  345.     public function setAlfenQuotationStatus(?string $alfenQuotationStatus): self
  346.     {
  347.         $this->alfenQuotationStatus $alfenQuotationStatus;
  348.         return $this;
  349.     }
  350.     public function getQuotation(): ?array
  351.     {
  352.         return $this->quotation;
  353.     }
  354.     public function setQuotation(array $quotation): self
  355.     {
  356.         $this->quotation $quotation;
  357.         return $this;
  358.     }
  359.     public function getAlfenLogFileName(): ?string
  360.     {
  361.         return $this->alfenLogFileName;
  362.     }
  363.     public function setAlfenLogFileName(?string $alfenLogFileName): self
  364.     {
  365.         $this->alfenLogFileName $alfenLogFileName;
  366.         return $this;
  367.     }
  368.     public function getOwner(): ?User
  369.     {
  370.         return $this->owner;
  371.     }
  372.     public function setOwner(?User $owner): self
  373.     {
  374.         $this->owner $owner;
  375.         return $this;
  376.     }
  377.     
  378.     public function getElementSettings(): ?ElementSettings
  379.     {
  380.         return $this->elementSettings;
  381.     }
  382.     public function setElementSettings(?ElementSettings $elementSettings): self
  383.     {
  384.         $this->elementSettings $elementSettings;
  385.         return $this;
  386.     }
  387.     public function getCopyFenceOfferId(): ?int
  388.     {
  389.         return $this->copyFenceOfferId;
  390.     }
  391.     public function setCopyFenceOfferId(?int $copyFenceOfferId): self
  392.     {
  393.         $this->copyFenceOfferId $copyFenceOfferId;
  394.         return $this;
  395.     }
  396.     public function getOrderNote(): ?string
  397.     {
  398.         return $this->orderNote;
  399.     }
  400.     public function setOrderNote(string $orderNote): self
  401.     {
  402.         $this->orderNote $orderNote;
  403.         return $this;
  404.     }
  405.     public function getCustomPdfHeaders(): ?array
  406.     {
  407.         return $this->customPdfHeaders;
  408.     }
  409.     public function setCustomPdfHeaders(array $customPdfHeaders): self
  410.     {
  411.         $this->customPdfHeaders $customPdfHeaders;
  412.         return $this;
  413.     }
  414.     public function getFenceColor(): ?FenceColorDictionary
  415.     {
  416.         return $this->fenceColor;
  417.     }
  418.     public function setFenceColor(?FenceColorDictionary $fenceColor): self
  419.     {
  420.         $this->fenceColor $fenceColor;
  421.         return $this;
  422.     }
  423. }