src/Entity/CommissionResult.php line 12

  1. <?php
  2. namespace App\Entity;
  3. use App\Enum\CommissionResultStatus;
  4. use App\Repository\CommissionResultRepository;
  5. use Doctrine\DBAL\Types\Types;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use Gedmo\Timestampable\Traits\TimestampableEntity;
  8. #[ORM\Entity(repositoryClassCommissionResultRepository::class)]
  9. class CommissionResult
  10. {
  11.     use TimestampableEntity;
  12.     #[ORM\Id]
  13.     #[ORM\GeneratedValue]
  14.     #[ORM\Column]
  15.     private ?int $id null;
  16.     #[ORM\ManyToOne]
  17.     #[ORM\JoinColumn(nullablefalse)]
  18.     private ?CommissionRule $commissionRule null;
  19.     #[ORM\ManyToOne()]
  20.     #[ORM\JoinColumn(nullablefalse)]
  21.     private ?CreditResult $creditResult null;
  22.     #[ORM\ManyToOne]
  23.     #[ORM\JoinColumn(nullablefalse)]
  24.     private ?User $user null;
  25.     #[ORM\Column(nullabletrue)]
  26.     private ?int $amountInPennies null;
  27.     #[ORM\Column(nullabletrue)]
  28.     private ?float $rate null;
  29.     #[ORM\ManyToOne]
  30.     private ?RateTableTier $rateTableTier null;
  31.     #[ORM\Column(typeTypes::DATETIME_MUTABLEnullabletrue)]
  32.     private ?\DateTimeInterface $releaseDate null;
  33.     #[ORM\ManyToOne]
  34.     private ?AttainmentMeasureResult $attainmentMeasureResult null;
  35.     #[ORM\Column(length255)]
  36.     private ?CommissionResultStatus $status null;
  37.     #[ORM\ManyToOne(inversedBy'commissionResults')]
  38.     #[ORM\JoinColumn(nullablefalse)]
  39.     private ?UserPaymentPeriod $userPaymentPeriod null;
  40.     #[ORM\ManyToOne(inversedBy'commissionResults')]
  41.     private ?AggregatedCommissions $aggregatedCommission null;
  42.     public function getId(): ?int
  43.     {
  44.         return $this->id;
  45.     }
  46.     public function getCommissionRule(): ?CommissionRule
  47.     {
  48.         return $this->commissionRule;
  49.     }
  50.     public function setCommissionRule(?CommissionRule $commissionRule): self
  51.     {
  52.         $this->commissionRule $commissionRule;
  53.         return $this;
  54.     }
  55.     public function getCreditResult(): ?CreditResult
  56.     {
  57.         return $this->creditResult;
  58.     }
  59.     public function setCreditResult(?CreditResult $creditResult): self
  60.     {
  61.         $this->creditResult $creditResult;
  62.         return $this;
  63.     }
  64.     public function getUser(): ?User
  65.     {
  66.         return $this->user;
  67.     }
  68.     public function setUser(?User $user): self
  69.     {
  70.         $this->user $user;
  71.         return $this;
  72.     }
  73.     public function getAmountInPennies(): ?int
  74.     {
  75.         return $this->amountInPennies;
  76.     }
  77.     public function setAmountInPennies(?int $amountInPennies): self
  78.     {
  79.         $this->amountInPennies $amountInPennies;
  80.         return $this;
  81.     }
  82.     public function getRate(): ?float
  83.     {
  84.         return $this->rate;
  85.     }
  86.     public function setRate(?float $rate): self
  87.     {
  88.         $this->rate $rate;
  89.         return $this;
  90.     }
  91.     public function getRateTableTier(): ?RateTableTier
  92.     {
  93.         return $this->rateTableTier;
  94.     }
  95.     public function setRateTableTier(?RateTableTier $rateTableTier): self
  96.     {
  97.         $this->rateTableTier $rateTableTier;
  98.         return $this;
  99.     }
  100.     public function getReleaseDate(): ?\DateTimeInterface
  101.     {
  102.         return $this->releaseDate;
  103.     }
  104.     public function setReleaseDate(?\DateTimeInterface $releaseDate): self
  105.     {
  106.         $this->releaseDate $releaseDate;
  107.         return $this;
  108.     }
  109.     public function getAttainmentMeasureResult(): ?AttainmentMeasureResult
  110.     {
  111.         return $this->attainmentMeasureResult;
  112.     }
  113.     // Used in forms since property paths don't handle ?->resultInPennies
  114.     public function getAttainmentMeasureResultInPennies(): int
  115.     {
  116.         return $this->attainmentMeasureResult?->getResultInPennies() ?: 0;
  117.     }
  118.     public function setAttainmentMeasureResult(?AttainmentMeasureResult $attainmentMeasureResult): self
  119.     {
  120.         $this->attainmentMeasureResult $attainmentMeasureResult;
  121.         return $this;
  122.     }
  123.     public function getStatus(): ?string
  124.     {
  125.         return $this->status;
  126.     }
  127.     public function setStatus(CommissionresultStatus $status): self
  128.     {
  129.         $this->status $status;
  130.         return $this;
  131.     }
  132.     public function getUserPaymentPeriod(): ?UserPaymentPeriod
  133.     {
  134.         return $this->userPaymentPeriod;
  135.     }
  136.     public function setUserPaymentPeriod(?UserPaymentPeriod $userPaymentPeriod): self
  137.     {
  138.         $this->userPaymentPeriod $userPaymentPeriod;
  139.         return $this;
  140.     }
  141.     public function getAggregatedCommission(): ?AggregatedCommissions
  142.     {
  143.         return $this->aggregatedCommission;
  144.     }
  145.     public function setAggregatedCommission(?AggregatedCommissions $aggregatedCommission): self
  146.     {
  147.         $this->aggregatedCommission $aggregatedCommission;
  148.         return $this;
  149.     }
  150. }