src/Entity/ManualPayment.php line 12

  1. <?php
  2. namespace App\Entity;
  3. use App\Enum\Currency;
  4. use App\Repository\ManualPaymentRepository;
  5. use Doctrine\DBAL\Types\Types;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use Gedmo\Timestampable\Traits\TimestampableEntity;
  8. #[ORM\Entity(repositoryClassManualPaymentRepository::class)]
  9. class ManualPayment
  10. {
  11.     use TimestampableEntity;
  12.     #[ORM\Id]
  13.     #[ORM\GeneratedValue]
  14.     #[ORM\Column]
  15.     private ?int $id null;
  16.     #[ORM\OneToOne(mappedBy'manualPayment'cascade: ['persist''remove'])]
  17.     private ?AggregatedTrueUp $aggregatedTrueUp null;
  18.     #[ORM\ManyToOne(inversedBy'manualPayments'fetch'EAGER')]
  19.     private ?User $user null;
  20.     #[ORM\Column]
  21.     private ?float $amount null;
  22.     #[ORM\Column(typeTypes::DATE_MUTABLEnullabletrue)]
  23.     private ?\DateTimeInterface $incentiveDate null;
  24.     #[ORM\Column(length255)]
  25.     private ?Currency $currency Currency::USD;
  26.     #[ORM\ManyToOne(inversedBy'manualPayments'fetch'EAGER')]
  27.     private ?ReasonCode $reasonCode null;
  28.     #[ORM\ManyToOne(inversedBy'manualPayments'fetch'EAGER')]
  29.     private ?EarningGroup $earningGroup null;
  30.     #[ORM\Column(typeTypes::TEXTnullabletrue)]
  31.     private ?string $note null;
  32.     public function __construct()
  33.     {
  34.         $this->incentiveDate = new \DateTime();
  35.     }
  36.     public function getId(): ?int
  37.     {
  38.         return $this->id;
  39.     }
  40.     public function setAggregatedTrueUp(?AggregatedTrueUp $aggregatedTrueUp): self
  41.     {
  42.         // unset the owning side of the relation if necessary
  43.         if ($aggregatedTrueUp === null && $this->aggregatedTrueUp !== null) {
  44.             $this->aggregatedTrueUp->setManualPayment(null);
  45.         }
  46.         // set the owning side of the relation if necessary
  47.         if ($aggregatedTrueUp !== null && $aggregatedTrueUp->getManualPayment() !== $this) {
  48.             $aggregatedTrueUp->setManualPayment($this);
  49.         }
  50.         $this->aggregatedTrueUp $aggregatedTrueUp;
  51.         return $this;
  52.     }
  53.     public function getUser(): ?User
  54.     {
  55.         return $this->user;
  56.     }
  57.     public function setUser(?User $user): static
  58.     {
  59.         $this->user $user;
  60.         return $this;
  61.     }
  62.     public function getAmount(): ?float
  63.     {
  64.         return $this->amount;
  65.     }
  66.     public function setAmount(float $amount): static
  67.     {
  68.         $this->amount $amount;
  69.         return $this;
  70.     }
  71.     public function getIncentiveDate(): ?\DateTimeInterface
  72.     {
  73.         return $this->incentiveDate;
  74.     }
  75.     public function setIncentiveDate(?\DateTimeInterface $incentiveDate): static
  76.     {
  77.         $this->incentiveDate $incentiveDate;
  78.         return $this;
  79.     }
  80.     public function getCurrency(): ?Currency
  81.     {
  82.         return $this->currency;
  83.     }
  84.     public function setCurrency(Currency $currency): static
  85.     {
  86.         $this->currency $currency;
  87.         return $this;
  88.     }
  89.     public function getReasonCode(): ?ReasonCode
  90.     {
  91.         return $this->reasonCode;
  92.     }
  93.     public function setReasonCode(?ReasonCode $reasonCode): static
  94.     {
  95.         $this->reasonCode $reasonCode;
  96.         return $this;
  97.     }
  98.     public function getEarningGroup(): ?EarningGroup
  99.     {
  100.         return $this->earningGroup;
  101.     }
  102.     public function setEarningGroup(?EarningGroup $earningGroup): static
  103.     {
  104.         $this->earningGroup $earningGroup;
  105.         return $this;
  106.     }
  107.     public function getNote(): ?string
  108.     {
  109.         return $this->note;
  110.     }
  111.     public function setNote(?string $note): static
  112.     {
  113.         $this->note $note;
  114.         return $this;
  115.     }
  116. }