src/Entity/ReferralCommission.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\ReferralCommissionRepository;
  6. use JMS\Serializer\Annotation as Serializer;
  7. /**
  8.  * @ORM\Table(name="v_referral_commission")
  9.  * @ORM\Entity(repositoryClass=ReferralCommissionRepository::class)
  10.  */
  11. class ReferralCommission
  12. {
  13.     /**
  14.      * @ORM\Id
  15.      * @ORM\GeneratedValue
  16.      * @ORM\Column(type="integer")
  17.      */
  18.     private $id;
  19.     /**
  20.      * @ORM\ManyToOne(targetEntity="App\Entity\User")
  21.      * @Serializer\Type("Relation")
  22.      */
  23.     private $referrerUser;
  24.     /**
  25.      * @ORM\ManyToOne(targetEntity="App\Entity\User")
  26.      * @Serializer\Type("Relation")
  27.      */
  28.     private $referredUser;
  29.     /**
  30.      * @var string
  31.      * @ORM\Column(name="referral_code", type="string", length=255)
  32.      */
  33.     private $referralCode;
  34.     /**
  35.      * @var string
  36.      * @ORM\Column(name="product", type="string", length=255, nullable=true)
  37.      */
  38.     private $product;
  39.     /**
  40.      * @var int
  41.      * @ORM\Column(name="sales_price", nullable=true)
  42.      */
  43.     private $salesPrice;
  44.     /**
  45.      * @var int
  46.      * @ORM\Column(type="integer")
  47.      */
  48.     private $commission;
  49.     /**
  50.      * @ORM\ManyToOne(targetEntity="App\Entity\Admin")
  51.      */
  52.     private $createdBy;
  53.     /**
  54.      * @var string
  55.      * @ORM\Column(name="note", type="text", nullable=true)
  56.      */
  57.     private $note;
  58.     use CreatedUpdatedTrait;
  59.     public function __toString(){
  60.         return (string) $this->id;
  61.     }
  62.     /**
  63.      * @return mixed
  64.      */
  65.     public function getId()
  66.     {
  67.         return $this->id;
  68.     }
  69.     /**
  70.      * @return mixed
  71.      */
  72.     public function getReferrerUser()
  73.     {
  74.         return $this->referrerUser;
  75.     }
  76.     /**
  77.      * @param mixed $referrerUser
  78.      */
  79.     public function setReferrerUser($referrerUser): void
  80.     {
  81.         $this->referrerUser $referrerUser;
  82.     }
  83.     /**
  84.      * @return mixed
  85.      */
  86.     public function getReferredUser()
  87.     {
  88.         return $this->referredUser;
  89.     }
  90.     /**
  91.      * @param mixed $referredUser
  92.      */
  93.     public function setReferredUser($referredUser): void
  94.     {
  95.         $this->referredUser $referredUser;
  96.     }
  97.     /**
  98.      * @return string
  99.      */
  100.     public function getReferralCode(): string
  101.     {
  102.         return $this->referralCode;
  103.     }
  104.     /**
  105.      * @param string $referralCode
  106.      */
  107.     public function setReferralCode(string $referralCode): void
  108.     {
  109.         $this->referralCode $referralCode;
  110.     }
  111.     /**
  112.      * @return string
  113.      */
  114.     public function getProduct(): string
  115.     {
  116.         return $this->product;
  117.     }
  118.     /**
  119.      * @param string $product
  120.      */
  121.     public function setProduct(string $product): void
  122.     {
  123.         $this->product $product;
  124.     }
  125.     /**
  126.      * @return int
  127.      */
  128.     public function getSalesPrice(): ?int
  129.     {
  130.         return $this->salesPrice;
  131.     }
  132.     /**
  133.      * @param int $salesPrice
  134.      */
  135.     public function setSalesPrice(?int $salesPrice): void
  136.     {
  137.         $this->salesPrice $salesPrice;
  138.     }
  139.     /**
  140.      * @return int
  141.      */
  142.     public function getCommission(): ?int
  143.     {
  144.         return $this->commission;
  145.     }
  146.     /**
  147.      * @param int $commission
  148.      */
  149.     public function setCommission(?int $commission): void
  150.     {
  151.         $this->commission $commission;
  152.     }
  153.     /**
  154.      * @return mixed
  155.      */
  156.     public function getCreatedBy()
  157.     {
  158.         return $this->createdBy;
  159.     }
  160.     /**
  161.      * @param mixed $createdBy
  162.      */
  163.     public function setCreatedBy($createdBy): void
  164.     {
  165.         $this->createdBy $createdBy;
  166.     }
  167.     /**
  168.      * @return string
  169.      */
  170.     public function getNote(): ?string
  171.     {
  172.         return $this->note;
  173.     }
  174.     /**
  175.      * @param string $note
  176.      */
  177.     public function setNote(?string $note): void
  178.     {
  179.         $this->note $note;
  180.     }
  181. }