src/Entity/Year.php line 12

  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\YearRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use Gedmo\Timestampable\Traits\TimestampableEntity;
  8. #[ORM\Entity(repositoryClassYearRepository::class)]
  9. class Year
  10. {
  11.     use TimestampableEntity;
  12.     #[ORM\Id]
  13.     #[ORM\GeneratedValue]
  14.     #[ORM\Column]
  15.     private ?int $id null;
  16.     #[ORM\Column]
  17.     private ?int $year null;
  18.     #[ORM\OneToMany(mappedBy'year'targetEntityPaymentPeriod::class, orphanRemovaltrue)]
  19.     private Collection $paymentPeriods;
  20.     #[ORM\OneToMany(mappedBy'year'targetEntityPlan::class, orphanRemovaltrue)]
  21.     private Collection $plans;
  22.     #[ORM\OneToMany(mappedBy'year'targetEntityCreditRule::class, orphanRemovaltrue)]
  23.     private Collection $creditRules;
  24.     #[ORM\OneToMany(mappedBy'year'targetEntityCommissionRule::class, orphanRemovaltrue)]
  25.     private Collection $commissionRules;
  26.     #[ORM\OneToMany(mappedBy'year'targetEntityRuleConditionOld::class, orphanRemovaltrue)]
  27.     private Collection $ruleConditionsOld;
  28.     #[ORM\OneToMany(mappedBy'year'targetEntityAttainmentMeasure::class, orphanRemovaltrue)]
  29.     private Collection $attainmentMeasures;
  30.     #[ORM\OneToMany(mappedBy'year'targetEntityCreditRuleResultFormula::class, orphanRemovaltrue)]
  31.     private Collection $creditRuleResultFormulas;
  32.     #[ORM\OneToMany(mappedBy'year'targetEntityCreditType::class, orphanRemovaltrue)]
  33.     private Collection $creditTypes;
  34.     #[ORM\OneToMany(mappedBy'year'targetEntityQuota::class, orphanRemovaltrue)]
  35.     private Collection $quotas;
  36.     #[ORM\OneToMany(mappedBy'year'targetEntityQuotaTier::class, orphanRemovaltrue)]
  37.     private Collection $quotaTiers;
  38.     #[ORM\OneToMany(mappedBy'year'targetEntityRateTable::class, orphanRemovaltrue)]
  39.     private Collection $rateTables;
  40.     #[ORM\OneToMany(mappedBy'year'targetEntityRateTableTier::class, orphanRemovaltrue)]
  41.     private Collection $rateTableTiers;
  42.     #[ORM\OneToMany(mappedBy'year'targetEntityTitle::class, orphanRemovaltrue)]
  43.     private Collection $titles;
  44.     public function __construct()
  45.     {
  46.         $this->paymentPeriods = new ArrayCollection();
  47.         $this->plans = new ArrayCollection();
  48.         $this->creditRules = new ArrayCollection();
  49.         $this->commissionRules = new ArrayCollection();
  50.         $this->ruleConditionsOld = new ArrayCollection();
  51.         $this->attainmentMeasures = new ArrayCollection();
  52.         $this->creditRuleResultFormulas = new ArrayCollection();
  53.         $this->creditTypes = new ArrayCollection();
  54.         $this->quotas = new ArrayCollection();
  55.         $this->quotaTiers = new ArrayCollection();
  56.         $this->rateTables = new ArrayCollection();
  57.         $this->rateTableTiers = new ArrayCollection();
  58.         $this->titles = new ArrayCollection();
  59.     }
  60.     public function getId(): ?int
  61.     {
  62.         return $this->id;
  63.     }
  64.     public function getYear(): ?int
  65.     {
  66.         return $this->year;
  67.     }
  68.     public function setYear(int $year): self
  69.     {
  70.         $this->year $year;
  71.         return $this;
  72.     }
  73.     /**
  74.      * @return Collection<int, PaymentPeriod>
  75.      */
  76.     public function getPaymentPeriods(): Collection
  77.     {
  78.         return $this->paymentPeriods;
  79.     }
  80.     public function addPaymentPeriod(PaymentPeriod $paymentPeriod): self
  81.     {
  82.         if (!$this->paymentPeriods->contains($paymentPeriod)) {
  83.             $this->paymentPeriods->add($paymentPeriod);
  84.             $paymentPeriod->setYear($this);
  85.         }
  86.         return $this;
  87.     }
  88.     public function removePaymentPeriod(PaymentPeriod $paymentPeriod): self
  89.     {
  90.         if ($this->paymentPeriods->removeElement($paymentPeriod)) {
  91.             // set the owning side to null (unless already changed)
  92.             if ($paymentPeriod->getYear() === $this) {
  93.                 $paymentPeriod->setYear(null);
  94.             }
  95.         }
  96.         return $this;
  97.     }
  98.     /**
  99.      * @return Collection<int, Plan>
  100.      */
  101.     public function getPlans(): Collection
  102.     {
  103.         return $this->plans;
  104.     }
  105.     public function addPlan(Plan $plan): self
  106.     {
  107.         if (!$this->plans->contains($plan)) {
  108.             $this->plans->add($plan);
  109.             $plan->setYear($this);
  110.         }
  111.         return $this;
  112.     }
  113.     public function removePlan(Plan $plan): self
  114.     {
  115.         if ($this->plans->removeElement($plan)) {
  116.             // set the owning side to null (unless already changed)
  117.             if ($plan->getYear() === $this) {
  118.                 $plan->setYear(null);
  119.             }
  120.         }
  121.         return $this;
  122.     }
  123.     /**
  124.      * @return Collection<int, CreditRule>
  125.      */
  126.     public function getCreditRules(): Collection
  127.     {
  128.         return $this->creditRules;
  129.     }
  130.     public function addCreditRule(CreditRule $creditRule): self
  131.     {
  132.         if (!$this->creditRules->contains($creditRule)) {
  133.             $this->creditRules->add($creditRule);
  134.             $creditRule->setYear($this);
  135.         }
  136.         return $this;
  137.     }
  138.     public function removeCreditRule(CreditRule $creditRule): self
  139.     {
  140.         if ($this->creditRules->removeElement($creditRule)) {
  141.             // set the owning side to null (unless already changed)
  142.             if ($creditRule->getYear() === $this) {
  143.                 $creditRule->setYear(null);
  144.             }
  145.         }
  146.         return $this;
  147.     }
  148.     /**
  149.      * @return Collection<int, CommissionRule>
  150.      */
  151.     public function getCommissionRules(): Collection
  152.     {
  153.         return $this->commissionRules;
  154.     }
  155.     public function addCommissionRule(CommissionRule $commissionRule): self
  156.     {
  157.         if (!$this->commissionRules->contains($commissionRule)) {
  158.             $this->commissionRules->add($commissionRule);
  159.             $commissionRule->setYear($this);
  160.         }
  161.         return $this;
  162.     }
  163.     public function removeCommissionRule(CommissionRule $commissionRule): self
  164.     {
  165.         if ($this->commissionRules->removeElement($commissionRule)) {
  166.             // set the owning side to null (unless already changed)
  167.             if ($commissionRule->getYear() === $this) {
  168.                 $commissionRule->setYear(null);
  169.             }
  170.         }
  171.         return $this;
  172.     }
  173.     /**
  174.      * @return Collection<int, RuleConditionOld>
  175.      */
  176.     public function getRuleConditions(): Collection
  177.     {
  178.         return $this->ruleConditionsOld;
  179.     }
  180.     public function addRuleCondition(RuleConditionOld $ruleCondition): self
  181.     {
  182.         if (!$this->ruleConditionsOld->contains($ruleCondition)) {
  183.             $this->ruleConditionsOld->add($ruleCondition);
  184.             $ruleCondition->setYear($this);
  185.         }
  186.         return $this;
  187.     }
  188.     public function removeRuleCondition(RuleConditionOld $ruleCondition): self
  189.     {
  190.         if ($this->ruleConditionsOld->removeElement($ruleCondition)) {
  191.             // set the owning side to null (unless already changed)
  192.             if ($ruleCondition->getYear() === $this) {
  193.                 $ruleCondition->setYear(null);
  194.             }
  195.         }
  196.         return $this;
  197.     }
  198.     /**
  199.      * @return Collection<int, AttainmentMeasure>
  200.      */
  201.     public function getAttainmentMeasures(): Collection
  202.     {
  203.         return $this->attainmentMeasures;
  204.     }
  205.     public function addAttainmentMeasure(AttainmentMeasure $attainmentMeasure): self
  206.     {
  207.         if (!$this->attainmentMeasures->contains($attainmentMeasure)) {
  208.             $this->attainmentMeasures->add($attainmentMeasure);
  209.             $attainmentMeasure->setYear($this);
  210.         }
  211.         return $this;
  212.     }
  213.     public function removeAttainmentMeasure(AttainmentMeasure $attainmentMeasure): self
  214.     {
  215.         if ($this->attainmentMeasures->removeElement($attainmentMeasure)) {
  216.             // set the owning side to null (unless already changed)
  217.             if ($attainmentMeasure->getYear() === $this) {
  218.                 $attainmentMeasure->setYear(null);
  219.             }
  220.         }
  221.         return $this;
  222.     }
  223.     /**
  224.      * @return Collection<int, CreditRuleResultFormula>
  225.      */
  226.     public function getCreditRuleResultFormulas(): Collection
  227.     {
  228.         return $this->creditRuleResultFormulas;
  229.     }
  230.     public function addCreditRuleResultFormula(CreditRuleResultFormula $creditRuleResultFormula): self
  231.     {
  232.         if (!$this->creditRuleResultFormulas->contains($creditRuleResultFormula)) {
  233.             $this->creditRuleResultFormulas->add($creditRuleResultFormula);
  234.             $creditRuleResultFormula->setYear($this);
  235.         }
  236.         return $this;
  237.     }
  238.     public function removeCreditRuleResultFormula(CreditRuleResultFormula $creditRuleResultFormula): self
  239.     {
  240.         if ($this->creditRuleResultFormulas->removeElement($creditRuleResultFormula)) {
  241.             // set the owning side to null (unless already changed)
  242.             if ($creditRuleResultFormula->getYear() === $this) {
  243.                 $creditRuleResultFormula->setYear(null);
  244.             }
  245.         }
  246.         return $this;
  247.     }
  248.     /**
  249.      * @return Collection<int, CreditType>
  250.      */
  251.     public function getCreditTypes(): Collection
  252.     {
  253.         return $this->creditTypes;
  254.     }
  255.     public function addCreditType(CreditType $creditType): self
  256.     {
  257.         if (!$this->creditTypes->contains($creditType)) {
  258.             $this->creditTypes->add($creditType);
  259.             $creditType->setYear($this);
  260.         }
  261.         return $this;
  262.     }
  263.     public function removeCreditType(CreditType $creditType): self
  264.     {
  265.         if ($this->creditTypes->removeElement($creditType)) {
  266.             // set the owning side to null (unless already changed)
  267.             if ($creditType->getYear() === $this) {
  268.                 $creditType->setYear(null);
  269.             }
  270.         }
  271.         return $this;
  272.     }
  273.     /**
  274.      * @return Collection<int, Quota>
  275.      */
  276.     public function getQuotas(): Collection
  277.     {
  278.         return $this->quotas;
  279.     }
  280.     public function addQuota(Quota $quota): self
  281.     {
  282.         if (!$this->quotas->contains($quota)) {
  283.             $this->quotas->add($quota);
  284.             $quota->setYear($this);
  285.         }
  286.         return $this;
  287.     }
  288.     public function removeQuota(Quota $quota): self
  289.     {
  290.         if ($this->quotas->removeElement($quota)) {
  291.             // set the owning side to null (unless already changed)
  292.             if ($quota->getYear() === $this) {
  293.                 $quota->setYear(null);
  294.             }
  295.         }
  296.         return $this;
  297.     }
  298.     /**
  299.      * @return Collection<int, QuotaTier>
  300.      */
  301.     public function getQuotaTiers(): Collection
  302.     {
  303.         return $this->quotaTiers;
  304.     }
  305.     public function addQuotaTier(QuotaTier $quotaTier): self
  306.     {
  307.         if (!$this->quotaTiers->contains($quotaTier)) {
  308.             $this->quotaTiers->add($quotaTier);
  309.             $quotaTier->setYear($this);
  310.         }
  311.         return $this;
  312.     }
  313.     public function removeQuotaTier(QuotaTier $quotaTier): self
  314.     {
  315.         if ($this->quotaTiers->removeElement($quotaTier)) {
  316.             // set the owning side to null (unless already changed)
  317.             if ($quotaTier->getYear() === $this) {
  318.                 $quotaTier->setYear(null);
  319.             }
  320.         }
  321.         return $this;
  322.     }
  323.     /**
  324.      * @return Collection<int, RateTable>
  325.      */
  326.     public function getRateTables(): Collection
  327.     {
  328.         return $this->rateTables;
  329.     }
  330.     public function addRateTable(RateTable $rateTable): self
  331.     {
  332.         if (!$this->rateTables->contains($rateTable)) {
  333.             $this->rateTables->add($rateTable);
  334.             $rateTable->setYear($this);
  335.         }
  336.         return $this;
  337.     }
  338.     public function removeRateTable(RateTable $rateTable): self
  339.     {
  340.         if ($this->rateTables->removeElement($rateTable)) {
  341.             // set the owning side to null (unless already changed)
  342.             if ($rateTable->getYear() === $this) {
  343.                 $rateTable->setYear(null);
  344.             }
  345.         }
  346.         return $this;
  347.     }
  348.     /**
  349.      * @return Collection<int, RateTableTier>
  350.      */
  351.     public function getRateTableTiers(): Collection
  352.     {
  353.         return $this->rateTableTiers;
  354.     }
  355.     public function addRateTableTier(RateTableTier $rateTableTier): self
  356.     {
  357.         if (!$this->rateTableTiers->contains($rateTableTier)) {
  358.             $this->rateTableTiers->add($rateTableTier);
  359.             $rateTableTier->setYear($this);
  360.         }
  361.         return $this;
  362.     }
  363.     public function removeRateTableTier(RateTableTier $rateTableTier): self
  364.     {
  365.         if ($this->rateTableTiers->removeElement($rateTableTier)) {
  366.             // set the owning side to null (unless already changed)
  367.             if ($rateTableTier->getYear() === $this) {
  368.                 $rateTableTier->setYear(null);
  369.             }
  370.         }
  371.         return $this;
  372.     }
  373.     /**
  374.      * @return Collection<int, Title>
  375.      */
  376.     public function getTitles(): Collection
  377.     {
  378.         return $this->titles;
  379.     }
  380.     public function addTitle(Title $title): self
  381.     {
  382.         if (!$this->titles->contains($title)) {
  383.             $this->titles->add($title);
  384.             $title->setYear($this);
  385.         }
  386.         return $this;
  387.     }
  388.     public function removeTitle(Title $title): self
  389.     {
  390.         if ($this->titles->removeElement($title)) {
  391.             // set the owning side to null (unless already changed)
  392.             if ($title->getYear() === $this) {
  393.                 $title->setYear(null);
  394.             }
  395.         }
  396.         return $this;
  397.     }
  398.     public function __toString() {
  399.         return (string) $this->year;
  400.     }
  401. }