src/Entity/MachinePaperSizeMatrix.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\MachinePaperSizeMatrixRepository;
  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=MachinePaperSizeMatrixRepository::class)
  10.  */
  11. class MachinePaperSizeMatrix
  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="integer")
  22.      */
  23.     private $setup;
  24.     /**
  25.      * @ORM\ManyToOne(targetEntity=Machine::class, inversedBy="machinePaperSizeMatrices")
  26.      * @ORM\JoinColumn(nullable=false)
  27.      */
  28.     private $machine;
  29.     /**
  30.      * @ORM\ManyToOne(targetEntity=PaperSize::class, inversedBy="machinePaperSizeMatrices")
  31.      * @ORM\JoinColumn(nullable=false)
  32.      */
  33.     private $paperSize;
  34.     /**
  35.      * @ORM\OneToMany(targetEntity=MachinePaperSizeCostMatrix::class, mappedBy="machinePaperSizeMatrix",
  36.      *     orphanRemoval=true, cascade={"persist", "remove"})
  37.      */
  38.     private $machinePaperSizeCostMatrices;
  39.     /**
  40.      * @ORM\OneToMany(targetEntity=MachinePaperSizeTimeMatrix::class, mappedBy="machinePaperSizeMatrix",
  41.      *     cascade={"persist", "remove"})
  42.      */
  43.     private $machinePaperSizeTimeMatrices;
  44.     /**
  45.      * @ORM\Column(type="decimal", precision=10, scale=2)
  46.      */
  47.     private $rate;
  48.     /**
  49.      * @ORM\OneToMany(targetEntity=MachinePaperSizeBlackOnlyClickMatrix::class, mappedBy="machinePaperSizeMatrix",
  50.      * cascade={"persist", "remove"})
  51.      */
  52.     private $machinePaperSizeBlackOnlyClickMatrices;
  53.     /**
  54.      * @ORM\Column(type="string", length=255, options={"default" : "Colour"})
  55.      */
  56.     private $colourClickLabel;
  57.     /**
  58.      * @ORM\Column(type="string", length=255, options={"default" : "Black Only"})
  59.      */
  60.     private $blackOnlyClickLabel;
  61.     public function __construct()
  62.     {
  63.         $this->machinePaperSizeCostMatrices = new ArrayCollection();
  64.         $this->machinePaperSizeTimeMatrices = new ArrayCollection();
  65.         $this->machinePaperSizeBlackOnlyClickMatrices = new ArrayCollection();
  66.     }
  67.     public function getId(): ?int
  68.     {
  69.         return $this->id;
  70.     }
  71.     public function getSetup(): ?int
  72.     {
  73.         return $this->setup;
  74.     }
  75.     public function setSetup(int $setup): self
  76.     {
  77.         $this->setup $setup;
  78.         return $this;
  79.     }
  80.     public function getMachine(): ?Machine
  81.     {
  82.         return $this->machine;
  83.     }
  84.     public function setMachine(?Machine $machine): self
  85.     {
  86.         $this->machine $machine;
  87.         return $this;
  88.     }
  89.     public function getPaperSize(): ?PaperSize
  90.     {
  91.         return $this->paperSize;
  92.     }
  93.     public function setPaperSize(?PaperSize $paperSize): self
  94.     {
  95.         $this->paperSize $paperSize;
  96.         return $this;
  97.     }
  98.     /**
  99.      * @return Collection<int, MachinePaperSizeCostMatrix>
  100.      */
  101.     public function getMachinePaperSizeCostMatrices(): Collection
  102.     {
  103.         return $this->machinePaperSizeCostMatrices;
  104.     }
  105.     public function addMachinePaperSizeCostMatrix(MachinePaperSizeCostMatrix $machinePaperSizeCostMatrix): self
  106.     {
  107.         if (!$this->machinePaperSizeCostMatrices->contains($machinePaperSizeCostMatrix)) {
  108.             $this->machinePaperSizeCostMatrices[] = $machinePaperSizeCostMatrix;
  109.             $machinePaperSizeCostMatrix->setMachinePaperSizeMatrix($this);
  110.         }
  111.         return $this;
  112.     }
  113.     public function removeMachinePaperSizeCostMatrix(MachinePaperSizeCostMatrix $machinePaperSizeCostMatrix): self
  114.     {
  115.         if ($this->machinePaperSizeCostMatrices->removeElement($machinePaperSizeCostMatrix)) {
  116.             // set the owning side to null (unless already changed)
  117.             if ($machinePaperSizeCostMatrix->getMachinePaperSizeMatrix() === $this) {
  118.                 $machinePaperSizeCostMatrix->setMachinePaperSizeMatrix(null);
  119.             }
  120.         }
  121.         return $this;
  122.     }
  123.     /**
  124.      * @return Collection<int, MachinePaperSizeTimeMatrix>
  125.      */
  126.     public function getMachinePaperSizeTimeMatrices(): Collection
  127.     {
  128.         return $this->machinePaperSizeTimeMatrices;
  129.     }
  130.     public function addMachinePaperSizeTimeMatrix(MachinePaperSizeTimeMatrix $machinePaperSizeTimeMatrix): self
  131.     {
  132.         if (!$this->machinePaperSizeTimeMatrices->contains($machinePaperSizeTimeMatrix)) {
  133.             $this->machinePaperSizeTimeMatrices[] = $machinePaperSizeTimeMatrix;
  134.             $machinePaperSizeTimeMatrix->setMachinePaperSizeMatrix($this);
  135.         }
  136.         return $this;
  137.     }
  138.     public function removeMachinePaperSizeTimeMatrix(MachinePaperSizeTimeMatrix $machinePaperSizeTimeMatrix): self
  139.     {
  140.         if ($this->machinePaperSizeTimeMatrices->removeElement($machinePaperSizeTimeMatrix)) {
  141.             // set the owning side to null (unless already changed)
  142.             if ($machinePaperSizeTimeMatrix->getMachinePaperSizeMatrix() === $this) {
  143.                 $machinePaperSizeTimeMatrix->setMachinePaperSizeMatrix(null);
  144.             }
  145.         }
  146.         return $this;
  147.     }
  148.     public function getRate(): ?string
  149.     {
  150.         return $this->rate;
  151.     }
  152.     public function setRate(string $rate): self
  153.     {
  154.         $this->rate $rate;
  155.         return $this;
  156.     }
  157.     /**
  158.      * @return Collection<int, MachinePaperSizeBlackOnlyClickMatrix>
  159.      */
  160.     public function getMachinePaperSizeBlackOnlyClickMatrices(): Collection
  161.     {
  162.         return $this->machinePaperSizeBlackOnlyClickMatrices;
  163.     }
  164.     public function addMachinePaperSizeBlackOnlyClickMatrix(MachinePaperSizeBlackOnlyClickMatrix $machinePaperSizeBlackOnlyClickMatrix): self
  165.     {
  166.         if (!$this->machinePaperSizeBlackOnlyClickMatrices->contains($machinePaperSizeBlackOnlyClickMatrix)) {
  167.             $this->machinePaperSizeBlackOnlyClickMatrices[] = $machinePaperSizeBlackOnlyClickMatrix;
  168.             $machinePaperSizeBlackOnlyClickMatrix->setMachinePaperSizeMatrix($this);
  169.         }
  170.         return $this;
  171.     }
  172.     public function removeMachinePaperSizeBlackOnlyClickMatrix(MachinePaperSizeBlackOnlyClickMatrix $machinePaperSizeBlackOnlyClickMatrix): self
  173.     {
  174.         if ($this->machinePaperSizeBlackOnlyClickMatrices->removeElement($machinePaperSizeBlackOnlyClickMatrix)) {
  175.             // set the owning side to null (unless already changed)
  176.             if ($machinePaperSizeBlackOnlyClickMatrix->getMachinePaperSizeMatrix() === $this) {
  177.                 $machinePaperSizeBlackOnlyClickMatrix->setMachinePaperSizeMatrix(null);
  178.             }
  179.         }
  180.         return $this;
  181.     }
  182.     public function getColourClickLabel(): ?string
  183.     {
  184.         return $this->colourClickLabel;
  185.     }
  186.     public function setColourClickLabel(?string $colourClickLabel): self
  187.     {
  188.         $this->colourClickLabel $colourClickLabel;
  189.         return $this;
  190.     }
  191.     public function getBlackOnlyClickLabel(): ?string
  192.     {
  193.         return $this->blackOnlyClickLabel;
  194.     }
  195.     public function setBlackOnlyClickLabel(string $blackOnlyClickLabel): self
  196.     {
  197.         $this->blackOnlyClickLabel $blackOnlyClickLabel;
  198.         return $this;
  199.     }
  200.     public function getSideClickLabel($side 'SideOne'):string
  201.     {
  202.         if ($side === 'SideOne') {
  203.             return $this->colourClickLabel;
  204.         }else{
  205.             return $this->blackOnlyClickLabel;
  206.         }
  207.     }
  208. }