src/Entity/RuleResult.php line 14

  1. <?php
  2. namespace App\Entity;
  3. use App\Enum\RuleRateType;
  4. use App\Enum\RuleResultRateType;
  5. use App\Repository\RuleResultRepository;
  6. use Doctrine\Common\Collections\ArrayCollection;
  7. use Doctrine\Common\Collections\Collection;
  8. use Doctrine\ORM\Mapping as ORM;
  9. use Gedmo\Timestampable\Traits\TimestampableEntity;
  10. #[ORM\Entity(repositoryClassRuleResultRepository::class)]
  11. class RuleResult
  12. {
  13.     use TimestampableEntity;
  14.     #[ORM\Id]
  15.     #[ORM\GeneratedValue]
  16.     #[ORM\Column]
  17.     private ?int $id null;
  18.     #[ORM\ManyToOne(inversedBy'ruleResults'fetch"EAGER")]
  19.     private ?Rule $rule null;
  20.     #[ORM\Column(length255nullabletrue)]
  21.     private ?string $name null;
  22.     #[ORM\ManyToOne(inversedBy'ruleResults'fetch"EAGER")]
  23.     private ?Quota $quota null;
  24.     #[ORM\Column(length255nullabletrue)]
  25.     private ?RuleResultRateType $rateType null;
  26.     #[ORM\ManyToOne(inversedBy'ruleResults'fetch"EAGER")]
  27.     private ?Period $quotaPeriod null;
  28.     #[ORM\ManyToOne(inversedBy'holdRuleResults'fetch"EAGER")]
  29.     private ?Formula $hold null;
  30.     #[ORM\ManyToOne(inversedBy'minimumRuleResults'fetch"EAGER")]
  31.     private ?Formula $minimum null;
  32.     #[ORM\ManyToOne(inversedBy'ruleResults'fetch"EAGER")]
  33.     private ?Formula $formula null;
  34.     #[ORM\Column(nullabletrue)]
  35.     private ?float $rate null;
  36.     #[ORM\ManyToOne(inversedBy'ruleResults'fetch"EAGER")]
  37.     private ?EarningGroup $earningGroup null;
  38.     #[ORM\ManyToOne(inversedBy'ruleResults'fetch"EAGER")]
  39.     private ?ReasonCode $reasonCode null;
  40.     #[ORM\ManyToOne(inversedBy'ruleResults'fetch"EAGER")]
  41.     private ?CreditType $creditType null;
  42.     #[ORM\Column]
  43.     private ?bool $rollable false;
  44.     #[ORM\OneToMany(mappedBy'ruleResult'targetEntityCredit::class)]
  45.     private Collection $credits;
  46.     #[ORM\OneToMany(mappedBy'ruleResult'targetEntityCommission::class)]
  47.     private Collection $commissions;
  48.     #[ORM\ManyToOne(inversedBy'ruleResults'fetch"EAGER")]
  49.     private ?LookUpTable $lookUpTable null;
  50.     #[ORM\ManyToOne(inversedBy'ruleResults'fetch"EAGER")]
  51.     private ?AttainmentMeasure $attainmentMeasure null;
  52.     #[ORM\ManyToOne(inversedBy'ruleResults'fetch"EAGER")]
  53.     private ?PayCurve $payCurve null;
  54.     public function __construct()
  55.     {
  56.         $this->credits = new ArrayCollection();
  57.         $this->commissions = new ArrayCollection();
  58.     }
  59.     public function getId(): ?int
  60.     {
  61.         return $this->id;
  62.     }
  63.     public function getRule(): ?Rule
  64.     {
  65.         return $this->rule;
  66.     }
  67.     public function setRule(?Rule $rule): static
  68.     {
  69.         $this->rule $rule;
  70.         return $this;
  71.     }
  72.     public function getName(): ?string
  73.     {
  74.         return $this->name;
  75.     }
  76.     public function setName(?string $name): static
  77.     {
  78.         $this->name $name;
  79.         return $this;
  80.     }
  81.     public function getQuota(): ?Quota
  82.     {
  83.         return $this->quota;
  84.     }
  85.     public function setQuota(?Quota $quota): static
  86.     {
  87.         $this->quota $quota;
  88.         return $this;
  89.     }
  90.     public function getRateType(): ?RuleResultRateType
  91.     {
  92.         return $this->rateType;
  93.     }
  94.     public function setRateType(?RuleResultRateType $rateType): static
  95.     {
  96.         $this->rateType $rateType;
  97.         return $this;
  98.     }
  99.     public function getQuotaPeriod(): ?Period
  100.     {
  101.         return $this->quotaPeriod;
  102.     }
  103.     public function setQuotaPeriod(?Period $quotaPeriod): static
  104.     {
  105.         $this->quotaPeriod $quotaPeriod;
  106.         return $this;
  107.     }
  108.     public function getHold(): ?Formula
  109.     {
  110.         return $this->hold;
  111.     }
  112.     public function setHold(?Formula $hold): static
  113.     {
  114.         $this->hold $hold;
  115.         return $this;
  116.     }
  117.     public function getMinimum(): ?Formula
  118.     {
  119.         return $this->minimum;
  120.     }
  121.     public function setMinimum(?Formula $minimum): static
  122.     {
  123.         $this->minimum $minimum;
  124.         return $this;
  125.     }
  126.     public function getFormula(): ?Formula
  127.     {
  128.         return $this->formula;
  129.     }
  130.     public function setFormula(?Formula $formula): static
  131.     {
  132.         $this->formula $formula;
  133.         return $this;
  134.     }
  135.     public function getRate(): ?float
  136.     {
  137.         return $this->rate;
  138.     }
  139.     public function setRate(?float $rate): static
  140.     {
  141.         $this->rate $rate;
  142.         return $this;
  143.     }
  144.     public function getEarningGroup(): ?EarningGroup
  145.     {
  146.         return $this->earningGroup;
  147.     }
  148.     public function setEarningGroup(?EarningGroup $earningGroup): static
  149.     {
  150.         $this->earningGroup $earningGroup;
  151.         return $this;
  152.     }
  153.     public function getReasonCode(): ?ReasonCode
  154.     {
  155.         return $this->reasonCode;
  156.     }
  157.     public function setReasonCode(?ReasonCode $reasonCode): static
  158.     {
  159.         $this->reasonCode $reasonCode;
  160.         return $this;
  161.     }
  162.     public function getCreditType(): ?CreditType
  163.     {
  164.         return $this->creditType;
  165.     }
  166.     public function setCreditType(?CreditType $creditType): static
  167.     {
  168.         $this->creditType $creditType;
  169.         return $this;
  170.     }
  171.     public function isRollable(): ?bool
  172.     {
  173.         return $this->rollable;
  174.     }
  175.     public function setRollable(bool $rollable): static
  176.     {
  177.         $this->rollable $rollable;
  178.         return $this;
  179.     }
  180.     /**
  181.      * @return Collection<int, Credit>
  182.      */
  183.     public function getCredits(): Collection
  184.     {
  185.         return $this->credits;
  186.     }
  187.     public function addCredit(Credit $credit): static
  188.     {
  189.         if (!$this->credits->contains($credit)) {
  190.             $this->credits->add($credit);
  191.             $credit->setRuleResult($this);
  192.         }
  193.         return $this;
  194.     }
  195.     public function removeCredit(Credit $credit): static
  196.     {
  197.         if ($this->credits->removeElement($credit)) {
  198.             // set the owning side to null (unless already changed)
  199.             if ($credit->getRuleResult() === $this) {
  200.                 $credit->setRuleResult(null);
  201.             }
  202.         }
  203.         return $this;
  204.     }
  205.     /**
  206.      * @return Collection<int, Commission>
  207.      */
  208.     public function getCommissions(): Collection
  209.     {
  210.         return $this->commissions;
  211.     }
  212.     public function addCommission(Commission $commission): static
  213.     {
  214.         if (!$this->commissions->contains($commission)) {
  215.             $this->commissions->add($commission);
  216.             $commission->setRuleResult($this);
  217.         }
  218.         return $this;
  219.     }
  220.     public function removeCommission(Commission $commission): static
  221.     {
  222.         if ($this->commissions->removeElement($commission)) {
  223.             // set the owning side to null (unless already changed)
  224.             if ($commission->getRuleResult() === $this) {
  225.                 $commission->setRuleResult(null);
  226.             }
  227.         }
  228.         return $this;
  229.     }
  230.     public function getLookUpTable(): ?LookUpTable
  231.     {
  232.         return $this->lookUpTable;
  233.     }
  234.     public function setLookUpTable(?LookUpTable $lookUpTable): static
  235.     {
  236.         $this->lookUpTable $lookUpTable;
  237.         return $this;
  238.     }
  239.     public function getAttainmentMeasure(): ?AttainmentMeasure
  240.     {
  241.         return $this->attainmentMeasure;
  242.     }
  243.     public function setAttainmentMeasure(?AttainmentMeasure $attainmentMeasure): static
  244.     {
  245.         $this->attainmentMeasure $attainmentMeasure;
  246.         return $this;
  247.     }
  248.     public function getPayCurve(): ?PayCurve
  249.     {
  250.         return $this->payCurve;
  251.     }
  252.     public function setPayCurve(?PayCurve $payCurve): static
  253.     {
  254.         $this->payCurve $payCurve;
  255.         return $this;
  256.     }
  257.     public function __toString(): string
  258.     {
  259.         return $this->getName();
  260.     }
  261. }