src/Entity/Imposition.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\ImpositionRepository;
  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=ImpositionRepository::class)
  10.  */
  11. class Imposition
  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="integer")
  26.      */
  27.     private $paperSizeAcross;
  28.     /**
  29.      * @ORM\Column(type="integer")
  30.      */
  31.     private $paperSizeDown;
  32.     /**
  33.      * @ORM\Column(type="integer")
  34.      */
  35.     private $impositionAcross;
  36.     /**
  37.      * @ORM\Column(type="integer")
  38.      */
  39.     private $impositionDown;
  40.     /**
  41.      * @ORM\Column(type="integer")
  42.      */
  43.     private $noAcrossToPrint;
  44.     /**
  45.      * @ORM\Column(type="integer")
  46.      */
  47.     private $gutterAcross;
  48.     /**
  49.      * @ORM\Column(type="integer")
  50.      */
  51.     private $gutterDown;
  52.     /**
  53.      * @ORM\Column(type="integer")
  54.      */
  55.     private $noDownToPrint;
  56.     /**
  57.      * @ORM\Column(type="integer")
  58.      */
  59.     private $noUp;
  60.     /**
  61.      * @ORM\OneToMany(targetEntity=Task::class, mappedBy="imposition")
  62.      */
  63.     private $tasks;
  64.     public function __construct()
  65.     {
  66.         $this->tasks = new ArrayCollection();
  67.     }
  68.     public function getId(): ?int
  69.     {
  70.         return $this->id;
  71.     }
  72.     public function getName(): ?string
  73.     {
  74.         return $this->name;
  75.     }
  76.     public function setName(string $name): self
  77.     {
  78.         $this->name $name;
  79.         return $this;
  80.     }
  81.     public function getPaperSizeAcross(): ?int
  82.     {
  83.         return $this->paperSizeAcross;
  84.     }
  85.     public function setPaperSizeAcross(int $paperSizeAcross): self
  86.     {
  87.         $this->paperSizeAcross $paperSizeAcross;
  88.         return $this;
  89.     }
  90.     public function getPaperSizeDown(): ?int
  91.     {
  92.         return $this->paperSizeDown;
  93.     }
  94.     public function setPaperSizeDown(int $paperSizeDown): self
  95.     {
  96.         $this->paperSizeDown $paperSizeDown;
  97.         return $this;
  98.     }
  99.     public function getImpositionAcross(): ?int
  100.     {
  101.         return $this->impositionAcross;
  102.     }
  103.     public function setImpositionAcross(int $impositionAcross): self
  104.     {
  105.         $this->impositionAcross $impositionAcross;
  106.         return $this;
  107.     }
  108.     public function getImpositionDown(): ?int
  109.     {
  110.         return $this->impositionDown;
  111.     }
  112.     public function setImpositionDown(int $impositionDown): self
  113.     {
  114.         $this->impositionDown $impositionDown;
  115.         return $this;
  116.     }
  117.     public function getNoAcrossToPrint(): ?int
  118.     {
  119.         return $this->noAcrossToPrint;
  120.     }
  121.     public function setNoAcrossToPrint(int $noAcrossToPrint): self
  122.     {
  123.         $this->noAcrossToPrint $noAcrossToPrint;
  124.         return $this;
  125.     }
  126.     public function getGutterAcross(): ?int
  127.     {
  128.         return $this->gutterAcross;
  129.     }
  130.     public function setGutterAcross(int $gutterAcross): self
  131.     {
  132.         $this->gutterAcross $gutterAcross;
  133.         return $this;
  134.     }
  135.     public function getGutterDown(): ?int
  136.     {
  137.         return $this->gutterDown;
  138.     }
  139.     public function setGutterDown(int $gutterDown): self
  140.     {
  141.         $this->gutterDown $gutterDown;
  142.         return $this;
  143.     }
  144.     public function getNoDownToPrint(): ?int
  145.     {
  146.         return $this->noDownToPrint;
  147.     }
  148.     public function setNoDownToPrint(int $noDownToPrint): self
  149.     {
  150.         $this->noDownToPrint $noDownToPrint;
  151.         return $this;
  152.     }
  153.     public function getNoUp(): ?int
  154.     {
  155.         return $this->noUp;
  156.     }
  157.     public function setNoUp(int $noUp): self
  158.     {
  159.         $this->noUp $noUp;
  160.         return $this;
  161.     }
  162.     /**
  163.      * @return Collection<int, Task>
  164.      */
  165.     public function getTasks(): Collection
  166.     {
  167.         return $this->tasks;
  168.     }
  169.     public function addTask(Task $task): self
  170.     {
  171.         if (!$this->tasks->contains($task)) {
  172.             $this->tasks[] = $task;
  173.             $task->setImposition($this);
  174.         }
  175.         return $this;
  176.     }
  177.     public function removeTask(Task $task): self
  178.     {
  179.         if ($this->tasks->removeElement($task)) {
  180.             // set the owning side to null (unless already changed)
  181.             if ($task->getImposition() === $this) {
  182.                 $task->setImposition(null);
  183.             }
  184.         }
  185.         return $this;
  186.     }
  187.     public function getCalculatorDisplayName():string
  188.     {
  189.         return '['.$this->paperSizeAcross.'x'.$this->paperSizeDown.']['.$this->noUp.']['.$this->name.']';
  190.     }
  191.     public function __toString() {
  192.         return $this->name;
  193.     }
  194. }