src/Entity/Calculator.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\CalculatorRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use \Gedmo\Timestampable\Traits\TimestampableEntity;
  8. /**
  9.  * @ORM\Entity(repositoryClass=CalculatorRepository::class)
  10.  */
  11. class Calculator
  12. {
  13.     use TimestampableEntity;
  14.     /**
  15.      * @ORM\Id
  16.      * @ORM\GeneratedValue
  17.      * @ORM\Column(type="integer")
  18.      */
  19.     private $id;
  20.     /**
  21.      * @ORM\Column(type="string", length=255)
  22.      */
  23.     private $name;
  24.     /**
  25.      * @ORM\Column(type="text", nullable=true)
  26.      */
  27.     private $description;
  28.     /**
  29.      * @ORM\Column(type="string", length=255, nullable=true)
  30.      */
  31.     private $template;
  32.     /**
  33.      * @ORM\OneToMany(targetEntity=PriceMatrix::class, mappedBy="calculator", cascade={"persist"})
  34.      */
  35.     private $priceMatrices;
  36.     /**
  37.      * @ORM\OneToMany(targetEntity=CalculatorProductBusinessCard::class, mappedBy="calculator")
  38.      */
  39.     private $calculatorProductBusinessCards;
  40.     /**
  41.      * @ORM\Column(type="decimal", precision=10, scale=3)
  42.      */
  43.     private $admin_base_fee;
  44.     /**
  45.      * @ORM\Column(type="decimal", precision=10, scale=3)
  46.      */
  47.     private $salesBaseFee;
  48.     public function __construct()
  49.     {
  50.         $this->priceMatrices = new ArrayCollection();
  51.         $this->calculatorProductBusinessCards = new ArrayCollection();
  52.     }
  53.     public function getId(): ?int
  54.     {
  55.         return $this->id;
  56.     }
  57.     public function getName(): ?string
  58.     {
  59.         return $this->name;
  60.     }
  61.     public function setName(string $name): self
  62.     {
  63.         $this->name $name;
  64.         return $this;
  65.     }
  66.     public function getDescription(): ?string
  67.     {
  68.         return $this->description;
  69.     }
  70.     public function setDescription(?string $description): self
  71.     {
  72.         $this->description $description;
  73.         return $this;
  74.     }
  75.     public function getTemplate(): ?string
  76.     {
  77.         return $this->template;
  78.     }
  79.     public function setTemplate(?string $template): self
  80.     {
  81.         $this->template $template;
  82.         return $this;
  83.     }
  84.     /**
  85.      * @return Collection<int, PriceMatrix>
  86.      */
  87.     public function getPriceMatrices(): Collection
  88.     {
  89.         return $this->priceMatrices;
  90.     }
  91.     public function addPriceMatrix(PriceMatrix $priceMatrix): self
  92.     {
  93.         if (!$this->priceMatrices->contains($priceMatrix)) {
  94.             $this->priceMatrices[] = $priceMatrix;
  95.             $priceMatrix->setCalculator($this);
  96.         }
  97.         return $this;
  98.     }
  99.     public function removePriceMatrix(PriceMatrix $priceMatrix): self
  100.     {
  101.         if ($this->priceMatrices->removeElement($priceMatrix)) {
  102.             // set the owning side to null (unless already changed)
  103.             if ($priceMatrix->getCalculator() === $this) {
  104.                 $priceMatrix->setCalculator(null);
  105.             }
  106.         }
  107.         return $this;
  108.     }
  109.     /**
  110.      * @return Collection<int, CalculatorProductBusinessCard>
  111.      */
  112.     public function getCalculatorProductBusinessCards(): Collection
  113.     {
  114.         return $this->calculatorProductBusinessCards;
  115.     }
  116.     public function addCalculatorProductBusinessCard(CalculatorProductBusinessCard $calculatorProductBusinessCard): self
  117.     {
  118.         if (!$this->calculatorProductBusinessCards->contains($calculatorProductBusinessCard)) {
  119.             $this->calculatorProductBusinessCards[] = $calculatorProductBusinessCard;
  120.             $calculatorProductBusinessCard->setCalculator($this);
  121.         }
  122.         return $this;
  123.     }
  124.     public function removeCalculatorProductBusinessCard(CalculatorProductBusinessCard $calculatorProductBusinessCard): self
  125.     {
  126.         if ($this->calculatorProductBusinessCards->removeElement($calculatorProductBusinessCard)) {
  127.             // set the owning side to null (unless already changed)
  128.             if ($calculatorProductBusinessCard->getCalculator() === $this) {
  129.                 $calculatorProductBusinessCard->setCalculator(null);
  130.             }
  131.         }
  132.         return $this;
  133.     }
  134.     public function getAdminBaseFee(): ?string
  135.     {
  136.         return $this->admin_base_fee;
  137.     }
  138.     public function setAdminBaseFee(string $admin_base_fee): self
  139.     {
  140.         $this->admin_base_fee $admin_base_fee;
  141.         return $this;
  142.     }
  143.     public function getSalesBaseFee(): ?string
  144.     {
  145.         return $this->salesBaseFee;
  146.     }
  147.     public function setSalesBaseFee(string $salesBaseFee): self
  148.     {
  149.         $this->salesBaseFee $salesBaseFee;
  150.         return $this;
  151.     }
  152. }