src/Entity/Year.php line 12
<?phpnamespace App\Entity;use App\Repository\YearRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;use Gedmo\Timestampable\Traits\TimestampableEntity;#[ORM\Entity(repositoryClass: YearRepository::class)]class Year{use TimestampableEntity;#[ORM\Id]#[ORM\GeneratedValue]#[ORM\Column]private ?int $id = null;#[ORM\Column]private ?int $year = null;#[ORM\OneToMany(mappedBy: 'year', targetEntity: PaymentPeriod::class, orphanRemoval: true)]private Collection $paymentPeriods;#[ORM\OneToMany(mappedBy: 'year', targetEntity: Plan::class, orphanRemoval: true)]private Collection $plans;#[ORM\OneToMany(mappedBy: 'year', targetEntity: CreditRule::class, orphanRemoval: true)]private Collection $creditRules;#[ORM\OneToMany(mappedBy: 'year', targetEntity: CommissionRule::class, orphanRemoval: true)]private Collection $commissionRules;#[ORM\OneToMany(mappedBy: 'year', targetEntity: RuleConditionOld::class, orphanRemoval: true)]private Collection $ruleConditionsOld;#[ORM\OneToMany(mappedBy: 'year', targetEntity: AttainmentMeasure::class, orphanRemoval: true)]private Collection $attainmentMeasures;#[ORM\OneToMany(mappedBy: 'year', targetEntity: CreditRuleResultFormula::class, orphanRemoval: true)]private Collection $creditRuleResultFormulas;#[ORM\OneToMany(mappedBy: 'year', targetEntity: CreditType::class, orphanRemoval: true)]private Collection $creditTypes;#[ORM\OneToMany(mappedBy: 'year', targetEntity: Quota::class, orphanRemoval: true)]private Collection $quotas;#[ORM\OneToMany(mappedBy: 'year', targetEntity: QuotaTier::class, orphanRemoval: true)]private Collection $quotaTiers;#[ORM\OneToMany(mappedBy: 'year', targetEntity: RateTable::class, orphanRemoval: true)]private Collection $rateTables;#[ORM\OneToMany(mappedBy: 'year', targetEntity: RateTableTier::class, orphanRemoval: true)]private Collection $rateTableTiers;#[ORM\OneToMany(mappedBy: 'year', targetEntity: Title::class, orphanRemoval: true)]private Collection $titles;public function __construct(){$this->paymentPeriods = new ArrayCollection();$this->plans = new ArrayCollection();$this->creditRules = new ArrayCollection();$this->commissionRules = new ArrayCollection();$this->ruleConditionsOld = new ArrayCollection();$this->attainmentMeasures = new ArrayCollection();$this->creditRuleResultFormulas = new ArrayCollection();$this->creditTypes = new ArrayCollection();$this->quotas = new ArrayCollection();$this->quotaTiers = new ArrayCollection();$this->rateTables = new ArrayCollection();$this->rateTableTiers = new ArrayCollection();$this->titles = new ArrayCollection();}public function getId(): ?int{return $this->id;}public function getYear(): ?int{return $this->year;}public function setYear(int $year): self{$this->year = $year;return $this;}/*** @return Collection<int, PaymentPeriod>*/public function getPaymentPeriods(): Collection{return $this->paymentPeriods;}public function addPaymentPeriod(PaymentPeriod $paymentPeriod): self{if (!$this->paymentPeriods->contains($paymentPeriod)) {$this->paymentPeriods->add($paymentPeriod);$paymentPeriod->setYear($this);}return $this;}public function removePaymentPeriod(PaymentPeriod $paymentPeriod): self{if ($this->paymentPeriods->removeElement($paymentPeriod)) {// set the owning side to null (unless already changed)if ($paymentPeriod->getYear() === $this) {$paymentPeriod->setYear(null);}}return $this;}/*** @return Collection<int, Plan>*/public function getPlans(): Collection{return $this->plans;}public function addPlan(Plan $plan): self{if (!$this->plans->contains($plan)) {$this->plans->add($plan);$plan->setYear($this);}return $this;}public function removePlan(Plan $plan): self{if ($this->plans->removeElement($plan)) {// set the owning side to null (unless already changed)if ($plan->getYear() === $this) {$plan->setYear(null);}}return $this;}/*** @return Collection<int, CreditRule>*/public function getCreditRules(): Collection{return $this->creditRules;}public function addCreditRule(CreditRule $creditRule): self{if (!$this->creditRules->contains($creditRule)) {$this->creditRules->add($creditRule);$creditRule->setYear($this);}return $this;}public function removeCreditRule(CreditRule $creditRule): self{if ($this->creditRules->removeElement($creditRule)) {// set the owning side to null (unless already changed)if ($creditRule->getYear() === $this) {$creditRule->setYear(null);}}return $this;}/*** @return Collection<int, CommissionRule>*/public function getCommissionRules(): Collection{return $this->commissionRules;}public function addCommissionRule(CommissionRule $commissionRule): self{if (!$this->commissionRules->contains($commissionRule)) {$this->commissionRules->add($commissionRule);$commissionRule->setYear($this);}return $this;}public function removeCommissionRule(CommissionRule $commissionRule): self{if ($this->commissionRules->removeElement($commissionRule)) {// set the owning side to null (unless already changed)if ($commissionRule->getYear() === $this) {$commissionRule->setYear(null);}}return $this;}/*** @return Collection<int, RuleConditionOld>*/public function getRuleConditions(): Collection{return $this->ruleConditionsOld;}public function addRuleCondition(RuleConditionOld $ruleCondition): self{if (!$this->ruleConditionsOld->contains($ruleCondition)) {$this->ruleConditionsOld->add($ruleCondition);$ruleCondition->setYear($this);}return $this;}public function removeRuleCondition(RuleConditionOld $ruleCondition): self{if ($this->ruleConditionsOld->removeElement($ruleCondition)) {// set the owning side to null (unless already changed)if ($ruleCondition->getYear() === $this) {$ruleCondition->setYear(null);}}return $this;}/*** @return Collection<int, AttainmentMeasure>*/public function getAttainmentMeasures(): Collection{return $this->attainmentMeasures;}public function addAttainmentMeasure(AttainmentMeasure $attainmentMeasure): self{if (!$this->attainmentMeasures->contains($attainmentMeasure)) {$this->attainmentMeasures->add($attainmentMeasure);$attainmentMeasure->setYear($this);}return $this;}public function removeAttainmentMeasure(AttainmentMeasure $attainmentMeasure): self{if ($this->attainmentMeasures->removeElement($attainmentMeasure)) {// set the owning side to null (unless already changed)if ($attainmentMeasure->getYear() === $this) {$attainmentMeasure->setYear(null);}}return $this;}/*** @return Collection<int, CreditRuleResultFormula>*/public function getCreditRuleResultFormulas(): Collection{return $this->creditRuleResultFormulas;}public function addCreditRuleResultFormula(CreditRuleResultFormula $creditRuleResultFormula): self{if (!$this->creditRuleResultFormulas->contains($creditRuleResultFormula)) {$this->creditRuleResultFormulas->add($creditRuleResultFormula);$creditRuleResultFormula->setYear($this);}return $this;}public function removeCreditRuleResultFormula(CreditRuleResultFormula $creditRuleResultFormula): self{if ($this->creditRuleResultFormulas->removeElement($creditRuleResultFormula)) {// set the owning side to null (unless already changed)if ($creditRuleResultFormula->getYear() === $this) {$creditRuleResultFormula->setYear(null);}}return $this;}/*** @return Collection<int, CreditType>*/public function getCreditTypes(): Collection{return $this->creditTypes;}public function addCreditType(CreditType $creditType): self{if (!$this->creditTypes->contains($creditType)) {$this->creditTypes->add($creditType);$creditType->setYear($this);}return $this;}public function removeCreditType(CreditType $creditType): self{if ($this->creditTypes->removeElement($creditType)) {// set the owning side to null (unless already changed)if ($creditType->getYear() === $this) {$creditType->setYear(null);}}return $this;}/*** @return Collection<int, Quota>*/public function getQuotas(): Collection{return $this->quotas;}public function addQuota(Quota $quota): self{if (!$this->quotas->contains($quota)) {$this->quotas->add($quota);$quota->setYear($this);}return $this;}public function removeQuota(Quota $quota): self{if ($this->quotas->removeElement($quota)) {// set the owning side to null (unless already changed)if ($quota->getYear() === $this) {$quota->setYear(null);}}return $this;}/*** @return Collection<int, QuotaTier>*/public function getQuotaTiers(): Collection{return $this->quotaTiers;}public function addQuotaTier(QuotaTier $quotaTier): self{if (!$this->quotaTiers->contains($quotaTier)) {$this->quotaTiers->add($quotaTier);$quotaTier->setYear($this);}return $this;}public function removeQuotaTier(QuotaTier $quotaTier): self{if ($this->quotaTiers->removeElement($quotaTier)) {// set the owning side to null (unless already changed)if ($quotaTier->getYear() === $this) {$quotaTier->setYear(null);}}return $this;}/*** @return Collection<int, RateTable>*/public function getRateTables(): Collection{return $this->rateTables;}public function addRateTable(RateTable $rateTable): self{if (!$this->rateTables->contains($rateTable)) {$this->rateTables->add($rateTable);$rateTable->setYear($this);}return $this;}public function removeRateTable(RateTable $rateTable): self{if ($this->rateTables->removeElement($rateTable)) {// set the owning side to null (unless already changed)if ($rateTable->getYear() === $this) {$rateTable->setYear(null);}}return $this;}/*** @return Collection<int, RateTableTier>*/public function getRateTableTiers(): Collection{return $this->rateTableTiers;}public function addRateTableTier(RateTableTier $rateTableTier): self{if (!$this->rateTableTiers->contains($rateTableTier)) {$this->rateTableTiers->add($rateTableTier);$rateTableTier->setYear($this);}return $this;}public function removeRateTableTier(RateTableTier $rateTableTier): self{if ($this->rateTableTiers->removeElement($rateTableTier)) {// set the owning side to null (unless already changed)if ($rateTableTier->getYear() === $this) {$rateTableTier->setYear(null);}}return $this;}/*** @return Collection<int, Title>*/public function getTitles(): Collection{return $this->titles;}public function addTitle(Title $title): self{if (!$this->titles->contains($title)) {$this->titles->add($title);$title->setYear($this);}return $this;}public function removeTitle(Title $title): self{if ($this->titles->removeElement($title)) {// set the owning side to null (unless already changed)if ($title->getYear() === $this) {$title->setYear(null);}}return $this;}public function __toString() {return (string) $this->year;}}