src/Entity/Envelope.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Entity\Traits\Sortable;
  4. use App\Entity\Traits\Timestampable;
  5. use App\Repository\EnvelopeRepository;
  6. use Doctrine\Common\Collections\ArrayCollection;
  7. use Doctrine\Common\Collections\Collection;
  8. use Doctrine\ORM\Mapping as ORM;
  9. #[ORM\Entity(repositoryClassEnvelopeRepository::class)]
  10. class Envelope
  11. {
  12.     use Timestampable;
  13.     use Sortable;
  14.     #[ORM\Id]
  15.     #[ORM\GeneratedValue]
  16.     #[ORM\Column(type'integer')]
  17.     private $id;
  18.     #[ORM\Column(type'string'length100)]
  19.     private $name;
  20.     #[ORM\Column(type'smallint')]
  21.     private $capacity;
  22.     #[ORM\Column(type'boolean')]
  23.     private $isShown true;
  24.     #[ORM\Column(type'boolean')]
  25.     private $isDeposited false;
  26.     #[ORM\Column(type'boolean')]
  27.     private $isExcluded false;
  28.     #[ORM\OneToMany(mappedBy'envelope'targetEntityCheck::class)]
  29.     private $checks;
  30.     #[ORM\ManyToOne(targetEntitySeason::class, inversedBy'envelopes')]
  31.     private $season;
  32.     public function __construct()
  33.     {
  34.         $this->checks = new ArrayCollection();
  35.     }
  36.     public function __clone()
  37.     {
  38.         $this->createdAt null;
  39.         $this->updatedAt null;
  40.         $this->id null;
  41.         $this->position = -1;
  42.         $this->checks = new ArrayCollection();
  43.         $this->setSeason(null);
  44.         $this->isDeposited false;
  45.         $this->isExcluded false;
  46.     }
  47.     public function getId(): ?int
  48.     {
  49.         return $this->id;
  50.     }
  51.     public function getName(): ?string
  52.     {
  53.         return $this->name;
  54.     }
  55.     public function setName(string $name): self
  56.     {
  57.         $this->name $name;
  58.         return $this;
  59.     }
  60.     public function getCapacity(): ?int
  61.     {
  62.         return $this->capacity;
  63.     }
  64.     public function setCapacity(int $capacity): self
  65.     {
  66.         $this->capacity $capacity;
  67.         return $this;
  68.     }
  69.     public function getIsShown(): ?bool
  70.     {
  71.         return $this->isShown;
  72.     }
  73.     public function setIsShown(bool $isShown): self
  74.     {
  75.         $this->isShown $isShown;
  76.         return $this;
  77.     }
  78.     public function getIsDeposited(): ?bool
  79.     {
  80.         return $this->isDeposited;
  81.     }
  82.     public function setIsDeposited(bool $isDeposited): self
  83.     {
  84.         $this->isDeposited $isDeposited;
  85.         return $this;
  86.     }
  87.     public function getIsExcluded(): ?bool
  88.     {
  89.         return $this->isExcluded;
  90.     }
  91.     public function setIsExcluded(bool $isExcluded): self
  92.     {
  93.         $this->isExcluded $isExcluded;
  94.         return $this;
  95.     }
  96.     /**
  97.      * @return Collection<int, Check>
  98.      */
  99.     public function getChecks(): Collection
  100.     {
  101.         return $this->checks;
  102.     }
  103.     public function addCheck(Check $check): self
  104.     {
  105.         if (!$this->checks->contains($check)) {
  106.             $this->checks[] = $check;
  107.             $check->setEnvelope($this);
  108.         }
  109.         return $this;
  110.     }
  111.     public function removeCheck(Check $check): self
  112.     {
  113.         if ($this->checks->removeElement($check)) {
  114.             // set the owning side to null (unless already changed)
  115.             if ($check->getEnvelope() === $this) {
  116.                 $check->setEnvelope(null);
  117.             }
  118.         }
  119.         return $this;
  120.     }
  121.     public function getSeason(): ?Season
  122.     {
  123.         return $this->season;
  124.     }
  125.     public function setSeason(?Season $season): self
  126.     {
  127.         $this->season $season;
  128.         return $this;
  129.     }
  130. }