src/Entity/PoolProgramType.php line 19

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\Common\Collections\ArrayCollection;
  4. use Doctrine\Common\Collections\Collection;
  5. use Doctrine\ORM\Mapping as ORM;
  6. use Symfony\Component\Security\Core\User\UserInterface;
  7. use Symfony\Component\Validator\Constraints as Assert;
  8. use Symfony\Component\Validator\GroupSequenceProviderInterface;
  9. use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
  10. use Gedmo\Mapping\Annotation as Gedmo;
  11. /**
  12.  * @ORM\Entity(repositoryClass="App\Repository\PoolProgramTypeRepository")
  13.  * @ORM\Table(name="poolprogram_type")
  14.  * @Gedmo\Loggable
  15.  */
  16. class PoolProgramType
  17. {
  18.     const TYPE_MORTGAGE "mortgage";
  19.     const TYPE_PUBLIC "public";
  20.     const TYPE_SHIP "ship";
  21.     const TYPE_MIXED "mixed";
  22.     /**
  23.      * @var int
  24.      *
  25.      * @ORM\Id
  26.      * @ORM\GeneratedValue
  27.      * @ORM\Column(type="integer")
  28.      */
  29.     private $id;
  30.     /**
  31.      * @ORM\Column(type="string", length=20)
  32.      */
  33.     private $name;
  34.     /**
  35.      * @ORM\Column(type="string", length=20)
  36.      */
  37.     private $title;
  38.     /**
  39.      * @ORM\Column(type="integer")
  40.      */
  41.     private $displayOrder;
  42.     // Linked table
  43.     // -------------------------------------------------------------------------
  44.     /**
  45.      * @ORM\OneToMany(targetEntity="App\Entity\PoolProgram", mappedBy="type")
  46.      */
  47.     private $poolPrograms;
  48.     /**
  49.      * @ORM\OneToMany(targetEntity="App\Entity\TableLogPoolProgram", mappedBy="type")
  50.      */
  51.     private $tableLogPools;
  52.     /**
  53.      * @ORM\OneToMany(targetEntity="App\Entity\HttParsingValue", mappedBy="poolType")
  54.      */
  55.     private $parsingValues;
  56.     public function __construct()
  57.     {
  58.         $this->poolPrograms = new ArrayCollection();
  59.         $this->parsingValues = new ArrayCollection();
  60.         $this->tableLogPools = new ArrayCollection();
  61.     }
  62.     // -------------------------------------------------------------------------
  63.     // Auto filled columns
  64.     // -------------------------------------------------------------------------
  65.     // Custom methods
  66.     public function __toString()
  67.     {
  68.         return $this->getTitle();
  69.     }
  70.     // -------------------------------------------------------------------------
  71.     // Auto generated methods
  72.     public function getId(): ?int
  73.     {
  74.         return $this->id;
  75.     }
  76.     public function getName(): ?string
  77.     {
  78.         return $this->name;
  79.     }
  80.     public function setName(string $name): self
  81.     {
  82.         $this->name $name;
  83.         return $this;
  84.     }
  85.     public function getTitle(): ?string
  86.     {
  87.         return $this->title;
  88.     }
  89.     public function setTitle(string $title): self
  90.     {
  91.         $this->title $title;
  92.         return $this;
  93.     }
  94.     /**
  95.      * @return Collection|PoolProgram[]
  96.      */
  97.     public function getPoolPrograms(): Collection
  98.     {
  99.         return $this->poolPrograms;
  100.     }
  101.     public function addPoolProgram(PoolProgram $poolProgram): self
  102.     {
  103.         if (!$this->poolPrograms->contains($poolProgram)) {
  104.             $this->poolPrograms[] = $poolProgram;
  105.             $poolProgram->setType($this);
  106.         }
  107.         return $this;
  108.     }
  109.     public function removePoolProgram(PoolProgram $poolProgram): self
  110.     {
  111.         if ($this->poolPrograms->removeElement($poolProgram)) {
  112.             // set the owning side to null (unless already changed)
  113.             if ($poolProgram->getType() === $this) {
  114.                 $poolProgram->setType(null);
  115.             }
  116.         }
  117.         return $this;
  118.     }
  119.     public function getDisplayOrder(): ?int
  120.     {
  121.         return $this->displayOrder;
  122.     }
  123.     public function setDisplayOrder(int $displayOrder): self
  124.     {
  125.         $this->displayOrder $displayOrder;
  126.         return $this;
  127.     }
  128.     /**
  129.      * @return Collection|HttParsingValue[]
  130.      */
  131.     public function getParsingValues(): Collection
  132.     {
  133.         return $this->parsingValues;
  134.     }
  135.     public function addParsingValue(HttParsingValue $parsingValue): self
  136.     {
  137.         if (!$this->parsingValues->contains($parsingValue)) {
  138.             $this->parsingValues[] = $parsingValue;
  139.             $parsingValue->setPoolType($this);
  140.         }
  141.         return $this;
  142.     }
  143.     public function removeParsingValue(HttParsingValue $parsingValue): self
  144.     {
  145.         if ($this->parsingValues->removeElement($parsingValue)) {
  146.             // set the owning side to null (unless already changed)
  147.             if ($parsingValue->getPoolType() === $this) {
  148.                 $parsingValue->setPoolType(null);
  149.             }
  150.         }
  151.         return $this;
  152.     }
  153.     /**
  154.      * @return Collection|PoolProgram[]
  155.      */
  156.     public function getTableLogPools(): Collection
  157.     {
  158.         return $this->tableLogPools;
  159.     }
  160.     public function addTableLogPool(PoolProgram $tableLogPool): self
  161.     {
  162.         if (!$this->tableLogPools->contains($tableLogPool)) {
  163.             $this->tableLogPools[] = $tableLogPool;
  164.             $tableLogPool->setType($this);
  165.         }
  166.         return $this;
  167.     }
  168.     public function removeTableLogPool(PoolProgram $tableLogPool): self
  169.     {
  170.         if ($this->tableLogPools->removeElement($tableLogPool)) {
  171.             // set the owning side to null (unless already changed)
  172.             if ($tableLogPool->getType() === $this) {
  173.                 $tableLogPool->setType(null);
  174.             }
  175.         }
  176.         return $this;
  177.     }
  178. }