<?php
namespace App\Entity;
use App\Repository\FenceOfferRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Loggable\Loggable;
use Gedmo\Timestampable\Traits\TimestampableEntity;
use Gedmo\Mapping\Annotation as Gedmo;
/**
* @ORM\Entity(repositoryClass=FenceOfferRepository::class)
* @Gedmo\Loggable
*/
class FenceOffer implements Loggable
{
/**
* Hook timestampable behavior
* updates createdAt, updatedAt fields
*/
use TimestampableEntity;
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\ManyToOne(targetEntity=FenceDictionary::class, inversedBy="fenceOffers")
* @ORM\JoinColumn(nullable=false)
* @Gedmo\Versioned
*/
private $fence;
/**
* @ORM\Column(type="json")
* @Gedmo\Versioned
*/
private $fenceConfigurationJson = [];
/**
* @ORM\Column(type="integer", nullable=true)
* @Gedmo\Versioned
*/
private $alfenOfferId;
/**
* @ORM\Column(type="text", nullable=true)
* @Gedmo\Versioned
*/
private $alfenHtmlResponse;
/**
* @ORM\Column(type="float", nullable=true)
* @Gedmo\Versioned
*/
private $offerNetAmount;
/**
* @ORM\Column(type="float", nullable=true)
* @Gedmo\Versioned
*/
private $discountedOfferNetAmount;
/**
* @ORM\Column(type="float", nullable=true)
* @Gedmo\Versioned
*/
private $netOfferTotal;
/**
* @ORM\Column(type="float", nullable=true)
* @Gedmo\Versioned
*/
private $grossOfferTotal;
/**
* @ORM\Column(type="string", length=255, nullable=true)
* @Gedmo\Versioned
*/
private $note;
/**
* @ORM\OneToMany(targetEntity=AdditionalOfferFee::class, mappedBy="fenceOffer")
*/
private $additionalOfferFees;
/**
* @ORM\OneToMany(targetEntity=FenceFace::class, mappedBy="fenceOffer")
*/
private $fenceFaces;
/**
* @ORM\OneToMany(targetEntity=File::class, mappedBy="fenceOffer")
*/
private $files;
/**
* @ORM\Column(type="string", length=255, nullable=true)
* @Gedmo\Versioned
*/
private $name;
/**
* @ORM\ManyToOne(targetEntity=Client::class, inversedBy="fenceOffers")
*/
private $client;
/**
* @ORM\ManyToOne(targetEntity=FenceElementDictionary::class)
* @ORM\JoinColumn(nullable=false)
*/
private $pole;
/**
* @ORM\Column(type="integer")
*/
private $height;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $alfenQuotationStatus;
/**
* @ORM\Column(type="json")
*/
private $quotation = [];
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $alfenLogFileName;
/**
* @ORM\ManyToOne(targetEntity=User::class)
* @ORM\JoinColumn(nullable=false)
*/
private $owner;
/**
* @ORM\ManyToOne(targetEntity=ElementSettings::class)
* @ORM\JoinColumn(nullable=false)
*/
private $elementSettings;
private $copyFenceOfferId;
/**
* @ORM\Column(type="string", length=184)
*/
private $orderNote;
/**
* @ORM\Column(type="json")
*/
private $customPdfHeaders = [];
/**
* @ORM\ManyToOne(targetEntity=FenceColorDictionary::class)
* @ORM\JoinColumn(nullable=false)
*/
private $fenceColor;
public function __construct()
{
$this->additionalOfferFees = new ArrayCollection();
$this->fenceFaces = new ArrayCollection();
$this->files = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getFence(): ?FenceDictionary
{
return $this->fence;
}
public function setFence(?FenceDictionary $fence): self
{
$this->fence = $fence;
return $this;
}
public function getFenceConfigurationJson(): ?array
{
return $this->fenceConfigurationJson;
}
public function setFenceConfigurationJson(array $fenceConfigurationJson): self
{
$this->fenceConfigurationJson = $fenceConfigurationJson;
return $this;
}
public function getAlfenOfferId(): ?int
{
return $this->alfenOfferId;
}
public function setAlfenOfferId(?int $alfenOfferId): self
{
$this->alfenOfferId = $alfenOfferId;
return $this;
}
public function getAlfenHtmlResponse(): ?string
{
return $this->alfenHtmlResponse;
}
public function setAlfenHtmlResponse(string $alfenHtmlResponse): self
{
$this->alfenHtmlResponse = $alfenHtmlResponse;
return $this;
}
public function getOfferNetAmount(): ?float
{
return $this->offerNetAmount;
}
public function setOfferNetAmount(float $offerNetAmount): self
{
$this->offerNetAmount = $offerNetAmount;
return $this;
}
public function getDiscountedOfferNetAmount(): ?float
{
return $this->discountedOfferNetAmount;
}
public function setDiscountedOfferNetAmount(float $discountedOfferNetAmount): self
{
$this->discountedOfferNetAmount = $discountedOfferNetAmount;
return $this;
}
public function getNetOfferTotal(): ?float
{
return $this->netOfferTotal;
}
public function setNetOfferTotal(float $netOfferTotal): self
{
$this->netOfferTotal = $netOfferTotal;
return $this;
}
public function getGrossOfferTotal(): ?float
{
return $this->grossOfferTotal;
}
public function setGrossOfferTotal(float $grossOfferTotal): self
{
$this->grossOfferTotal = $grossOfferTotal;
return $this;
}
public function getNote(): ?string
{
return $this->note;
}
public function setNote(string $note): self
{
$this->note = $note;
return $this;
}
/**
* @return Collection<int, AdditionalOfferFee>
*/
public function getAdditionalOfferFees(): Collection
{
return $this->additionalOfferFees;
}
public function addAdditionalOfferFee(AdditionalOfferFee $additionalOfferFee): self
{
if (!$this->additionalOfferFees->contains($additionalOfferFee)) {
$this->additionalOfferFees[] = $additionalOfferFee;
$additionalOfferFee->setFenceOffer($this);
}
return $this;
}
public function removeAdditionalOfferFee(AdditionalOfferFee $additionalOfferFee): self
{
if ($this->additionalOfferFees->removeElement($additionalOfferFee)) {
// set the owning side to null (unless already changed)
if ($additionalOfferFee->getFenceOffer() === $this) {
$additionalOfferFee->setFenceOffer(null);
}
}
return $this;
}
/**
* @return Collection<int, FenceFace>
*/
public function getFenceFaces(): Collection
{
return $this->fenceFaces;
}
public function addFenceFace(FenceFace $fenceFace): self
{
if (!$this->fenceFaces->contains($fenceFace)) {
$this->fenceFaces[] = $fenceFace;
$fenceFace->setFenceOffer($this);
}
return $this;
}
public function removeFenceFace(FenceFace $fenceFace): self
{
if ($this->fenceFaces->removeElement($fenceFace)) {
// set the owning side to null (unless already changed)
if ($fenceFace->getFenceOffer() === $this) {
$fenceFace->setFenceOffer(null);
}
}
return $this;
}
/**
* @return Collection<int, File>
*/
public function getFiles(): Collection
{
return $this->files;
}
public function addFile(File $file): self
{
if (!$this->files->contains($file)) {
$this->files[] = $file;
$file->setFenceOffer($this);
}
return $this;
}
public function removeFile(File $file): self
{
if ($this->files->removeElement($file)) {
// set the owning side to null (unless already changed)
if ($file->getFenceOffer() === $this) {
$file->setFenceOffer(null);
}
}
return $this;
}
public function getName(): ?string
{
return $this->name;
}
public function setName(?string $name): self
{
$this->name = $name;
return $this;
}
public function getClient(): ?Client
{
return $this->client;
}
public function setClient(?Client $client): self
{
$this->client = $client;
return $this;
}
public function getPole(): ?FenceElementDictionary
{
return $this->pole;
}
public function setPole(?FenceElementDictionary $pole): self
{
$this->pole = $pole;
return $this;
}
public function getHeight(): ?int
{
return $this->height;
}
public function setHeight(int $height): self
{
$this->height = $height;
return $this;
}
public function getAlfenQuotationStatus(): ?string
{
return $this->alfenQuotationStatus;
}
public function setAlfenQuotationStatus(?string $alfenQuotationStatus): self
{
$this->alfenQuotationStatus = $alfenQuotationStatus;
return $this;
}
public function getQuotation(): ?array
{
return $this->quotation;
}
public function setQuotation(array $quotation): self
{
$this->quotation = $quotation;
return $this;
}
public function getAlfenLogFileName(): ?string
{
return $this->alfenLogFileName;
}
public function setAlfenLogFileName(?string $alfenLogFileName): self
{
$this->alfenLogFileName = $alfenLogFileName;
return $this;
}
public function getOwner(): ?User
{
return $this->owner;
}
public function setOwner(?User $owner): self
{
$this->owner = $owner;
return $this;
}
public function getElementSettings(): ?ElementSettings
{
return $this->elementSettings;
}
public function setElementSettings(?ElementSettings $elementSettings): self
{
$this->elementSettings = $elementSettings;
return $this;
}
public function getCopyFenceOfferId(): ?int
{
return $this->copyFenceOfferId;
}
public function setCopyFenceOfferId(?int $copyFenceOfferId): self
{
$this->copyFenceOfferId = $copyFenceOfferId;
return $this;
}
public function getOrderNote(): ?string
{
return $this->orderNote;
}
public function setOrderNote(string $orderNote): self
{
$this->orderNote = $orderNote;
return $this;
}
public function getCustomPdfHeaders(): ?array
{
return $this->customPdfHeaders;
}
public function setCustomPdfHeaders(array $customPdfHeaders): self
{
$this->customPdfHeaders = $customPdfHeaders;
return $this;
}
public function getFenceColor(): ?FenceColorDictionary
{
return $this->fenceColor;
}
public function setFenceColor(?FenceColorDictionary $fenceColor): self
{
$this->fenceColor = $fenceColor;
return $this;
}
}