src/Entity/ReferralPayout.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. use App\Traits\CreatedUpdatedTrait;
  5. use App\Repository\ReferralPayoutRepository;
  6. use JMS\Serializer\Annotation as Serializer;
  7. /**
  8.  * @ORM\Table(name="v_referral_payout")
  9.  * @ORM\Entity(repositoryClass=ReferralPayoutRepository::class)
  10.  */
  11. class ReferralPayout
  12. {
  13.     const STATUS_REQUESTED 'REQUESTED';
  14.     const STATUS_PAID 'PAID';
  15.     public static function getStatusDefinitions(){
  16.         return [
  17.             self::STATUS_PAID => 'Paid',
  18.             self::STATUS_REQUESTED => 'Requested',
  19.         ];
  20.     }
  21.     /**
  22.      * @ORM\Id
  23.      * @ORM\GeneratedValue
  24.      * @ORM\Column(type="integer")
  25.      */
  26.     private $id;
  27.     /**
  28.      * @ORM\ManyToOne(targetEntity="App\Entity\User")
  29.      * @Serializer\Type("Relation")
  30.      */
  31.     private $referrerUser;
  32.     /**
  33.      * @var int
  34.      * @ORM\Column(type="integer", nullable=true)
  35.      */
  36.     private $amount;
  37.     /**
  38.      * @var string
  39.      * @ORM\Column(name="status", type="string", length=30)
  40.      */
  41.     private $status;
  42.     /**
  43.      * @ORM\ManyToOne(targetEntity="App\Entity\Admin")
  44.      */
  45.     private $paidBy;
  46.     /**
  47.      * @var \DateTime
  48.      *
  49.      * @ORM\Column(name="paid_date", type="date", nullable=true)
  50.      */
  51.     private $paidDate;
  52.     /**
  53.      * @var string
  54.      * @ORM\Column(name="note", type="text", nullable=true)
  55.      */
  56.     private $note;
  57.     use CreatedUpdatedTrait;
  58.     public function __toString(){
  59.         return (string) $this->id;
  60.     }
  61.     /**
  62.      * @return mixed
  63.      */
  64.     public function getId()
  65.     {
  66.         return $this->id;
  67.     }
  68.     /**
  69.      * @return mixed
  70.      */
  71.     public function getReferrerUser()
  72.     {
  73.         return $this->referrerUser;
  74.     }
  75.     /**
  76.      * @param mixed $referrerUser
  77.      */
  78.     public function setReferrerUser($referrerUser): void
  79.     {
  80.         $this->referrerUser $referrerUser;
  81.     }
  82.     /**
  83.      * @return int
  84.      */
  85.     public function getAmount(): ?int
  86.     {
  87.         return $this->amount;
  88.     }
  89.     /**
  90.      * @param int $amount
  91.      */
  92.     public function setAmount(?int $amount): void
  93.     {
  94.         $this->amount $amount;
  95.     }
  96.     /**
  97.      * @return string
  98.      */
  99.     public function getStatus(): string
  100.     {
  101.         return $this->status;
  102.     }
  103.     /**
  104.      * @param string $status
  105.      */
  106.     public function setStatus(string $status): void
  107.     {
  108.         $this->status $status;
  109.     }
  110.     /**
  111.      * @return mixed
  112.      */
  113.     public function getPaidBy()
  114.     {
  115.         return $this->paidBy;
  116.     }
  117.     /**
  118.      * @param mixed $paidBy
  119.      */
  120.     public function setPaidBy($paidBy): void
  121.     {
  122.         $this->paidBy $paidBy;
  123.     }
  124.     /**
  125.      * @return \DateTime
  126.      */
  127.     public function getPaidDate(): ?\DateTime
  128.     {
  129.         return $this->paidDate;
  130.     }
  131.     /**
  132.      * @param \DateTime $paidDate
  133.      */
  134.     public function setPaidDate(?\DateTime $paidDate): void
  135.     {
  136.         $this->paidDate $paidDate;
  137.     }
  138.     /**
  139.      * @return string
  140.      */
  141.     public function getNote(): ?string
  142.     {
  143.         return $this->note;
  144.     }
  145.     /**
  146.      * @param string $note
  147.      */
  148.     public function setNote(?string $note): void
  149.     {
  150.         $this->note $note;
  151.     }
  152. }