<?php
namespace App\Entity;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Security\Core\User\UserInterface;
use Symfony\Component\Validator\Constraints as Assert;
use Symfony\Component\Validator\GroupSequenceProviderInterface;
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
use Gedmo\Mapping\Annotation as Gedmo;
/**
* @ORM\Entity(repositoryClass="App\Repository\PoolProgramTypeRepository")
* @ORM\Table(name="poolprogram_type")
* @Gedmo\Loggable
*/
class PoolProgramType
{
const TYPE_MORTGAGE = "mortgage";
const TYPE_PUBLIC = "public";
const TYPE_SHIP = "ship";
const TYPE_MIXED = "mixed";
/**
* @var int
*
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=20)
*/
private $name;
/**
* @ORM\Column(type="string", length=20)
*/
private $title;
/**
* @ORM\Column(type="integer")
*/
private $displayOrder;
// Linked table
// -------------------------------------------------------------------------
/**
* @ORM\OneToMany(targetEntity="App\Entity\PoolProgram", mappedBy="type")
*/
private $poolPrograms;
/**
* @ORM\OneToMany(targetEntity="App\Entity\TableLogPoolProgram", mappedBy="type")
*/
private $tableLogPools;
/**
* @ORM\OneToMany(targetEntity="App\Entity\HttParsingValue", mappedBy="poolType")
*/
private $parsingValues;
public function __construct()
{
$this->poolPrograms = new ArrayCollection();
$this->parsingValues = new ArrayCollection();
$this->tableLogPools = new ArrayCollection();
}
// -------------------------------------------------------------------------
// Auto filled columns
// -------------------------------------------------------------------------
// Custom methods
public function __toString()
{
return $this->getTitle();
}
// -------------------------------------------------------------------------
// Auto generated methods
public function getId(): ?int
{
return $this->id;
}
public function getName(): ?string
{
return $this->name;
}
public function setName(string $name): self
{
$this->name = $name;
return $this;
}
public function getTitle(): ?string
{
return $this->title;
}
public function setTitle(string $title): self
{
$this->title = $title;
return $this;
}
/**
* @return Collection|PoolProgram[]
*/
public function getPoolPrograms(): Collection
{
return $this->poolPrograms;
}
public function addPoolProgram(PoolProgram $poolProgram): self
{
if (!$this->poolPrograms->contains($poolProgram)) {
$this->poolPrograms[] = $poolProgram;
$poolProgram->setType($this);
}
return $this;
}
public function removePoolProgram(PoolProgram $poolProgram): self
{
if ($this->poolPrograms->removeElement($poolProgram)) {
// set the owning side to null (unless already changed)
if ($poolProgram->getType() === $this) {
$poolProgram->setType(null);
}
}
return $this;
}
public function getDisplayOrder(): ?int
{
return $this->displayOrder;
}
public function setDisplayOrder(int $displayOrder): self
{
$this->displayOrder = $displayOrder;
return $this;
}
/**
* @return Collection|HttParsingValue[]
*/
public function getParsingValues(): Collection
{
return $this->parsingValues;
}
public function addParsingValue(HttParsingValue $parsingValue): self
{
if (!$this->parsingValues->contains($parsingValue)) {
$this->parsingValues[] = $parsingValue;
$parsingValue->setPoolType($this);
}
return $this;
}
public function removeParsingValue(HttParsingValue $parsingValue): self
{
if ($this->parsingValues->removeElement($parsingValue)) {
// set the owning side to null (unless already changed)
if ($parsingValue->getPoolType() === $this) {
$parsingValue->setPoolType(null);
}
}
return $this;
}
/**
* @return Collection|PoolProgram[]
*/
public function getTableLogPools(): Collection
{
return $this->tableLogPools;
}
public function addTableLogPool(PoolProgram $tableLogPool): self
{
if (!$this->tableLogPools->contains($tableLogPool)) {
$this->tableLogPools[] = $tableLogPool;
$tableLogPool->setType($this);
}
return $this;
}
public function removeTableLogPool(PoolProgram $tableLogPool): self
{
if ($this->tableLogPools->removeElement($tableLogPool)) {
// set the owning side to null (unless already changed)
if ($tableLogPool->getType() === $this) {
$tableLogPool->setType(null);
}
}
return $this;
}
}