src/Entity/PayCurveTier.php line 10

  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\PayCurveTierRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use Gedmo\Timestampable\Traits\TimestampableEntity;
  6. #[ORM\Entity(repositoryClassPayCurveTierRepository::class)]
  7. class PayCurveTier
  8. {
  9.     use TimestampableEntity;
  10.     #[ORM\Id]
  11.     #[ORM\GeneratedValue]
  12.     #[ORM\Column]
  13.     private ?int $id null;
  14.     #[ORM\Column]
  15.     private ?float $quotaAttainment 0;
  16.     #[ORM\Column]
  17.     private ?float $targetIncome 0;
  18.     #[ORM\Column]
  19.     private ?int $tierRank 0;
  20.     #[ORM\ManyToOne(inversedBy'payCurveTiers')]
  21.     private ?PayCurve $payCurve null;
  22.     #[ORM\Column]
  23.     private ?float $personalRateMultiplier null;
  24.     public function getId(): ?int
  25.     {
  26.         return $this->id;
  27.     }
  28.     public function getQuotaAttainment(): ?float
  29.     {
  30.         return $this->quotaAttainment;
  31.     }
  32.     public function setQuotaAttainment(float $quotaAttainment): static
  33.     {
  34.         $this->quotaAttainment $quotaAttainment;
  35.         return $this;
  36.     }
  37.     public function getTargetIncome(): ?float
  38.     {
  39.         return $this->targetIncome;
  40.     }
  41.     public function setTargetIncome(float $targetIncome): static
  42.     {
  43.         $this->targetIncome $targetIncome;
  44.         return $this;
  45.     }
  46.     public function getTierRank(): ?int
  47.     {
  48.         return $this->tierRank;
  49.     }
  50.     public function setTierRank(int $tierRank): static
  51.     {
  52.         $this->tierRank $tierRank;
  53.         return $this;
  54.     }
  55.     public function getPayCurve(): ?PayCurve
  56.     {
  57.         return $this->payCurve;
  58.     }
  59.     public function setPayCurve(?PayCurve $payCurve): static
  60.     {
  61.         $this->payCurve $payCurve;
  62.         return $this;
  63.     }
  64.     public function getPersonalRateMultiplier(): ?float
  65.     {
  66.         return $this->personalRateMultiplier;
  67.     }
  68.     public function setPersonalRateMultiplier(float $personalRateMultiplier): static
  69.     {
  70.         $this->personalRateMultiplier $personalRateMultiplier;
  71.         return $this;
  72.     }
  73.     public function tierName()
  74.     {
  75.         if ($this->tierRank == 0) {
  76.             return 'Threshold';
  77.         }
  78.         return sprintf('Tier %d'$this->tierRank);
  79.     }
  80.     
  81.     public function __toString(): string
  82.     {
  83.         return $this->tierName();
  84.     }
  85. }