src/Entity/RateTable.php line 14
<?phpnamespace App\Entity;use App\Enum\AttainmentUnitType;use App\Repository\RateTableRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\DBAL\Types\Types;use Doctrine\ORM\Mapping as ORM;use Gedmo\Timestampable\Traits\TimestampableEntity;#[ORM\Entity(repositoryClass: RateTableRepository::class)]class RateTable{use TimestampableEntity;#[ORM\Id]#[ORM\GeneratedValue]#[ORM\Column]private ?int $id = null;#[ORM\Column(length: 255)]private ?string $name = null;#[ORM\Column]private ?AttainmentUnitType $attainmentUnitType = AttainmentUnitType::PERCENT;#[ORM\Column(type: Types::TEXT, nullable: true)]private ?string $description = null;#[ORM\Column(type: Types::DATETIME_MUTABLE, nullable: true)]private ?\DateTimeInterface $effectiveStartDate = null;#[ORM\Column(type: Types::DATETIME_MUTABLE, nullable: true)]private ?\DateTimeInterface $effectiveEndDate = null;#[ORM\ManyToOne(targetEntity: self::class, inversedBy: 'overrides')]private ?self $parent = null;#[ORM\OneToMany(mappedBy: 'parent', targetEntity: self::class, cascade: ['PERSIST'])]private Collection $overrides;#[ORM\ManyToOne]private ?Title $title = null;#[ORM\ManyToOne]private ?User $user = null;#[ORM\ManyToOne(inversedBy: 'rateTables')]private ?Year $year = null;#[ORM\ManyToOne]private ?CreditType $creditType = null;#[ORM\OneToMany(mappedBy: 'rateTable', targetEntity: Commission::class)]private Collection $commissions;#[ORM\OneToMany(mappedBy: 'rateTable', targetEntity: RateTableAssignment::class, cascade: ['persist', 'remove'])]#[ORM\OrderBy(['type' => 'ASC'])]private Collection $rateTableAssignments;public function __construct(){$this->overrides = new ArrayCollection();$this->commissions = new ArrayCollection();$this->rateTableAssignments = new ArrayCollection();}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 getAttainmentUnitType(): ?AttainmentUnitType{return $this->attainmentUnitType;}public function setAttainmentUnitType(AttainmentUnitType $attainmentUnitType): self{$this->attainmentUnitType = $attainmentUnitType;return $this;}public function getDescription(): ?string{return $this->description;}public function setDescription(?string $description): self{$this->description = $description;return $this;}public function getEffectiveStartDate(): ?\DateTimeInterface{return $this->effectiveStartDate;}public function setEffectiveStartDate(?\DateTimeInterface $effectiveStartDate): self{$this->effectiveStartDate = $effectiveStartDate;return $this;}public function getEffectiveEndDate(): ?\DateTimeInterface{return $this->effectiveEndDate;}public function setEffectiveEndDate(?\DateTimeInterface $effectiveEndDate): self{$this->effectiveEndDate = $effectiveEndDate;return $this;}public function __toString(){return (string)$this->name;}public function getParent(): ?self{return $this->parent;}public function setParent(?self $parent): self{$this->parent = $parent;return $this;}/*** @return Collection<int, self>*/public function getOverrides(): Collection{return $this->overrides;}public function addOverride(self $override): self{if (!$this->overrides->contains($override)) {$this->overrides->add($override);$override->setParent($this);}return $this;}public function removeOverride(self $override): self{if ($this->overrides->removeElement($override)) {// set the owning side to null (unless already changed)if ($override->getParent() === $this) {$override->setParent(null);}}return $this;}public function getUser(): ?User{return $this->user;}public function setUser(?User $user): self{$this->user = $user;return $this;}public function getTitle(): ?Title{return $this->title;}public function setTitle(?Title $title): self{$this->title = $title;return $this;}public function getYear(): ?Year{return $this->year;}public function setYear(?Year $year): self{$this->year = $year;return $this;}public function getCreditType(): ?CreditType{return $this->creditType;}public function setCreditType(?CreditType $creditType): self{$this->creditType = $creditType;return $this;}/*** @return Collection<int, Commission>*/public function getCommissions(): Collection{return $this->commissions;}public function addCommission(Commission $commission): static{if (!$this->commissions->contains($commission)) {$this->commissions->add($commission);$commission->setRateTable($this);}return $this;}public function removeCommission(Commission $commission): static{if ($this->commissions->removeElement($commission)) {// set the owning side to null (unless already changed)if ($commission->getRateTable() === $this) {$commission->setRateTable(null);}}return $this;}/*** @return Collection<int, RateTableAssignment>*/public function getRateTableAssignments(): Collection{return $this->rateTableAssignments;}public function addRateTableAssignment(RateTableAssignment $rateTableAssignment): static{if (!$this->rateTableAssignments->contains($rateTableAssignment)) {$this->rateTableAssignments->add($rateTableAssignment);$rateTableAssignment->setRateTable($this);}return $this;}public function removeRateTableAssignment(RateTableAssignment $rateTableAssignment): static{if ($this->rateTableAssignments->removeElement($rateTableAssignment)) {// set the owning side to null (unless already changed)if ($rateTableAssignment->getRateTable() === $this) {$rateTableAssignment->setRateTable(null);}}return $this;}}