<?php
namespace App\Entity;
use App\Repository\CalculatorRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use \Gedmo\Timestampable\Traits\TimestampableEntity;
/**
* @ORM\Entity(repositoryClass=CalculatorRepository::class)
*/
class Calculator
{
use TimestampableEntity;
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=255)
*/
private $name;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $description;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $template;
/**
* @ORM\OneToMany(targetEntity=PriceMatrix::class, mappedBy="calculator", cascade={"persist"})
*/
private $priceMatrices;
/**
* @ORM\OneToMany(targetEntity=CalculatorProductBusinessCard::class, mappedBy="calculator")
*/
private $calculatorProductBusinessCards;
/**
* @ORM\Column(type="decimal", precision=10, scale=3)
*/
private $admin_base_fee;
/**
* @ORM\Column(type="decimal", precision=10, scale=3)
*/
private $salesBaseFee;
public function __construct()
{
$this->priceMatrices = new ArrayCollection();
$this->calculatorProductBusinessCards = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getName(): ?string
{
return $this->name;
}
public function setName(string $name): self
{
$this->name = $name;
return $this;
}
public function getDescription(): ?string
{
return $this->description;
}
public function setDescription(?string $description): self
{
$this->description = $description;
return $this;
}
public function getTemplate(): ?string
{
return $this->template;
}
public function setTemplate(?string $template): self
{
$this->template = $template;
return $this;
}
/**
* @return Collection<int, PriceMatrix>
*/
public function getPriceMatrices(): Collection
{
return $this->priceMatrices;
}
public function addPriceMatrix(PriceMatrix $priceMatrix): self
{
if (!$this->priceMatrices->contains($priceMatrix)) {
$this->priceMatrices[] = $priceMatrix;
$priceMatrix->setCalculator($this);
}
return $this;
}
public function removePriceMatrix(PriceMatrix $priceMatrix): self
{
if ($this->priceMatrices->removeElement($priceMatrix)) {
// set the owning side to null (unless already changed)
if ($priceMatrix->getCalculator() === $this) {
$priceMatrix->setCalculator(null);
}
}
return $this;
}
/**
* @return Collection<int, CalculatorProductBusinessCard>
*/
public function getCalculatorProductBusinessCards(): Collection
{
return $this->calculatorProductBusinessCards;
}
public function addCalculatorProductBusinessCard(CalculatorProductBusinessCard $calculatorProductBusinessCard): self
{
if (!$this->calculatorProductBusinessCards->contains($calculatorProductBusinessCard)) {
$this->calculatorProductBusinessCards[] = $calculatorProductBusinessCard;
$calculatorProductBusinessCard->setCalculator($this);
}
return $this;
}
public function removeCalculatorProductBusinessCard(CalculatorProductBusinessCard $calculatorProductBusinessCard): self
{
if ($this->calculatorProductBusinessCards->removeElement($calculatorProductBusinessCard)) {
// set the owning side to null (unless already changed)
if ($calculatorProductBusinessCard->getCalculator() === $this) {
$calculatorProductBusinessCard->setCalculator(null);
}
}
return $this;
}
public function getAdminBaseFee(): ?string
{
return $this->admin_base_fee;
}
public function setAdminBaseFee(string $admin_base_fee): self
{
$this->admin_base_fee = $admin_base_fee;
return $this;
}
public function getSalesBaseFee(): ?string
{
return $this->salesBaseFee;
}
public function setSalesBaseFee(string $salesBaseFee): self
{
$this->salesBaseFee = $salesBaseFee;
return $this;
}
}