<?php
namespace App\Entity;
use App\Repository\BusinessCardOptionRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Timestampable\Traits\TimestampableEntity;
/**
* @ORM\Entity(repositoryClass=BusinessCardOptionRepository::class)
*/
class BusinessCardOption
{
use TimestampableEntity;
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\ManyToOne(targetEntity=CalculatorProductBusinessCard::class, inversedBy="businessCardOptions")
*/
private $calculatorProductBusinessCard;
/**
* @ORM\ManyToOne(targetEntity=Machine::class, inversedBy="businessCardOptions")
*/
private $machine;
/**
* @ORM\ManyToOne(targetEntity=PaperSize::class)
*/
private $paperSize;
/**
* @ORM\Column(type="integer")
*/
private $finishedSizeX;
/**
* @ORM\Column(type="integer")
*/
private $finishedSizeY;
/**
* @ORM\ManyToOne(targetEntity=Imposition::class)
*/
private $imposition;
/**
* @ORM\Column(type="string", length=255)
*/
private $sideOne;
/**
* @ORM\Column(type="string", length=255)
*/
private $sideTwo;
/**
* @ORM\ManyToMany(targetEntity=Task::class, inversedBy="businessCardOptions", cascade={"persist"})
*/
private $tasks;
/**
* @ORM\ManyToOne(targetEntity=Machine::class, inversedBy="businessCardOptions")
*/
private $printingType;
/**
* @ORM\ManyToOne(targetEntity=Product::class, inversedBy="businessCardOptions")
*/
private $paperType;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $name;
public function __construct()
{
$this->tasks = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getCalculatorProductBusinessCard(): ?CalculatorProductBusinessCard
{
return $this->calculatorProductBusinessCard;
}
public function setCalculatorProductBusinessCard(?CalculatorProductBusinessCard $calculatorProductBusinessCard): self
{
$this->calculatorProductBusinessCard = $calculatorProductBusinessCard;
return $this;
}
public function getMachine(): ?Machine
{
return $this->machine;
}
public function setMachine(?Machine $machine): self
{
$this->machine = $machine;
return $this;
}
public function getPaperSize(): ?PaperSize
{
return $this->paperSize;
}
public function setPaperSize(?PaperSize $paperSize): self
{
$this->paperSize = $paperSize;
return $this;
}
public function getFinishedSizeX(): ?int
{
return $this->finishedSizeX;
}
public function setFinishedSizeX(int $finishedSizeX): self
{
$this->finishedSizeX = $finishedSizeX;
return $this;
}
public function getFinishedSizeY(): ?int
{
return $this->finishedSizeY;
}
public function setFinishedSizeY(int $finishedSizeY): self
{
$this->finishedSizeY = $finishedSizeY;
return $this;
}
public function getImposition(): ?Imposition
{
return $this->imposition;
}
public function setImposition(?Imposition $imposition): self
{
$this->imposition = $imposition;
return $this;
}
public function getSideOne(): ?string
{
return $this->sideOne;
}
public function setSideOne(string $sideOne): self
{
$this->sideOne = $sideOne;
return $this;
}
public function getSideTwo(): ?string
{
return $this->sideTwo;
}
public function setSideTwo(string $sideTwo): self
{
$this->sideTwo = $sideTwo;
return $this;
}
/**
* @return Collection<int, Task>
*/
public function getTasks(): Collection
{
return $this->tasks;
}
public function addTask(Task $task): self
{
if (!$this->tasks->contains($task)) {
$this->tasks[] = $task;
}
return $this;
}
public function removeTask(Task $task): self
{
$this->tasks->removeElement($task);
return $this;
}
public function getPrintingType(): ?Machine
{
return $this->printingType;
}
public function setPrintingType(?Machine $printingType): self
{
$this->printingType = $printingType;
return $this;
}
public function getPaperType(): ?Product
{
return $this->paperType;
}
public function setPaperType(?Product $paperType): self
{
$this->paperType = $paperType;
return $this;
}
public function getName(): ?string
{
return $this->name;
}
public function setName(?string $name): self
{
$this->name = $name;
return $this;
}
/* function __clone(){
$this->id = null;
//$this->tasks = $tasks;
}*/
}