src/Entity/PtsAdquiRedemRules.php line 15

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. use App\Util\UUIDGeneratorUtil;
  5. /**
  6.  * Description of PtsAdquiRedemRules
  7.  * @author aealan
  8.  * @ORM\HasLifecycleCallbacks()
  9.  * @ORM\Table(name="ptar_adqui_redem_rules")
  10.  * @ORM\Entity(repositoryClass="App\Repository\PtsAdquiRedemRulesRepository")
  11.  */
  12. class PtsAdquiRedemRules {
  13.     const LICENSE_STATUS_PENDING 0;
  14.     const LICENSE_STATUS_ACTIVE 1;
  15.     const LICENSE_STATUS_INACTIVE 2;
  16.     const DEVICE_ANDROID_TYPE 0;
  17.     const DEVICE_LITE_TYPE 1;
  18.     const DEVICE_HYBRID_TYPE 2;
  19.     /**
  20.      * @var integer
  21.      * @ORM\Column(name="ptar_id", type="guid")
  22.      * @ORM\Id
  23.      * @ORM\GeneratedValue(strategy="NONE")
  24.      */
  25.     private $id;
  26.     /**
  27.      * @var string
  28.      * @ORM\Column(name="ptar_name", type="string", length=100, nullable=false)
  29.      */
  30.     private $name;
  31.     /**
  32.      * @var string
  33.      * @ORM\Column(name="ptar_pts_rate", type="decimal", precision=10, scale=2)
  34.      */
  35.     private $ptsRate;
  36.     /**
  37.      * @var string
  38.      * @ORM\Column(name="ptar_watchable_objetc", type="string", length=100, nullable=true)
  39.      */
  40.     private $watchableObject;
  41.     /**
  42.      * @var string
  43.      * @ORM\Column(name="ptar_apply_to_specific_record", type="guid", nullable=true)
  44.      */
  45.     private $applyToSpecificRecord;
  46.     /**
  47.      * @var string
  48.      * @ORM\Column(name="ptar_just_claim_once", type="boolean", nullable=true)
  49.      */
  50.     private $justClaimOnce false;
  51.     /**
  52.      * @var \DateTime
  53.      * @ORM\Column(name="ptar_creation_date", type="datetime", nullable=false)
  54.      */
  55.     private $creationDate;
  56.     /**
  57.      * @var \DateTime
  58.      * @ORM\Column(name="ptar_update_date", type="datetime", nullable=true)
  59.      */
  60.     private $updateDate;
  61.     /**
  62.      * @var \DateTime
  63.      * @ORM\Column(name="ptar_delete_date", type="datetime", nullable=true)
  64.      */
  65.     private $deleteDate;
  66.     /**
  67.      * @var \DateTime
  68.      * @ORM\Column(name="ptar_initial_activation_date", type="datetime", nullable=false)
  69.      */
  70.     private $initialActivationDate;
  71.     /**
  72.      * @var \DateTime
  73.      * @ORM\Column(name="ptar_final_activation_date", type="datetime", nullable=true)
  74.      */
  75.     private $finalActivationDate;
  76.     /**
  77.      * @var \App\Entity\TypePtsGenericDefinitionRules
  78.      * @ORM\ManyToOne(targetEntity="App\Entity\TypePtsGenericDefinitionRules")
  79.      * @ORM\JoinColumns({
  80.      *   @ORM\JoinColumn(name="ptar_basic_definition", referencedColumnName="pgdr_id")
  81.      * })
  82.      */
  83.     private $basicDefinition;
  84.     /**
  85.      * @var \App\Entity\PtsAdquiRedemRules
  86.      * @ORM\ManyToOne(targetEntity="App\Entity\PtsAdquiRedemRules")
  87.      * @ORM\JoinColumns({
  88.      *   @ORM\JoinColumn(name="ptar_parent_definition", referencedColumnName="ptar_id", nullable=true)
  89.      * })
  90.      */
  91.     private $parentDefinition;
  92.     /**
  93.      * @var \App\Entity\AccountLicense
  94.      * @ORM\ManyToOne(targetEntity="App\Entity\AccountLicense")
  95.      * @ORM\JoinColumns({
  96.      *   @ORM\JoinColumn(name="ptar_license", referencedColumnName="al_id", nullable=true, onDelete="CASCADE")
  97.      * })
  98.      */
  99.     private $license;
  100.     /**
  101.      * @var \App\Entity\TypePoint
  102.      * @ORM\ManyToOne(targetEntity="App\Entity\TypePoint")
  103.      * @ORM\JoinColumns({
  104.      *   @ORM\JoinColumn(name="ptar_pt_type", referencedColumnName="tp_id", onDelete="CASCADE")
  105.      * })
  106.      */
  107.     private $pointType;
  108.     /**
  109.      * @var string
  110.      * @ORM\Column(name="ptar_minimum_purchase", type="decimal", precision=10, scale=2, nullable=true, options={"default":0})
  111.      */
  112.     private $minimumPurchase 0;
  113.     
  114.     /**
  115.      * @var string
  116.      * @ORM\Column(name="ptar_minimum_purchase_quantity", type="integer", nullable=true)
  117.      */
  118.     private $minimumQuantityPurchase;
  119.     
  120.     /**
  121.      * An specific amount of points depending in the achivement of sertain action by the user
  122.      * @var integer
  123.      * @ORM\Column(name="ptar_just_get_these_pts", type="integer", nullable=true)
  124.      */
  125.     private $justGetThesePoints;
  126.     
  127.     /**
  128.      * @return type
  129.      */
  130.     public function getId() {
  131.         return $this->id;
  132.     }
  133.     /**
  134.      * @return type
  135.      */
  136.     public function getJustGetThesePoints() {
  137.         return $this->justGetThesePoints;
  138.     }
  139.     /**
  140.      * @param type $justGetThesePoints
  141.      */
  142.     public function setJustGetThesePoints($justGetThesePoints) {
  143.         $this->justGetThesePoints $justGetThesePoints;
  144.     }
  145.     /**
  146.      * @return type
  147.      */
  148.     public function getMinimumPurchase() {
  149.         return $this->minimumPurchase;
  150.     }
  151.     /**
  152.      * @return type
  153.      */
  154.     public function getMinimumQuantityPurchase() {
  155.         return $this->minimumQuantityPurchase;
  156.     }
  157.     /**
  158.      * @param type $minimumPurchase
  159.      */
  160.     public function setMinimumPurchase($minimumPurchase) {
  161.         $this->minimumPurchase $minimumPurchase;
  162.     }
  163.     /**
  164.      * @param type $minimumQuantityPurchase
  165.      */
  166.     public function setMinimumQuantityPurchase($minimumQuantityPurchase) {
  167.         $this->minimumQuantityPurchase $minimumQuantityPurchase;
  168.     }
  169.     /**
  170.      * @return \App\Entity\TypePoint
  171.      */
  172.     public function getPointType(): \App\Entity\TypePoint {
  173.         return $this->pointType;
  174.     }
  175.     /**
  176.      * @param \App\Entity\TypePoint $pointType
  177.      */
  178.     public function setPointType(\App\Entity\TypePoint $pointType) {
  179.         $this->pointType $pointType;
  180.     }
  181.     /**
  182.      * @return type
  183.      */
  184.     public function getName() {
  185.         return $this->name;
  186.     }
  187.     /**
  188.      * @return type
  189.      */
  190.     public function getPtsRate() {
  191.         return $this->ptsRate;
  192.     }
  193.     /**
  194.      * @return type
  195.      */
  196.     public function getWatchableObject() {
  197.         return $this->watchableObject;
  198.     }
  199.     /**
  200.      * @return type
  201.      */
  202.     public function getApplyToSpecificRecord() {
  203.         return $this->applyToSpecificRecord;
  204.     }
  205.     /**
  206.      * @return type
  207.      */
  208.     public function getJustClaimOnce() {
  209.         return $this->justClaimOnce;
  210.     }
  211.     /**
  212.      * @return \DateTime
  213.      */
  214.     public function getCreationDate(): \DateTime {
  215.         return $this->creationDate;
  216.     }
  217.     /**
  218.      * @return \DateTime
  219.      */
  220.     public function getUpdateDate(): \DateTime {
  221.         return $this->updateDate;
  222.     }
  223.     /**
  224.      * @return \DateTime
  225.      */
  226.     public function getDeleteDate(): \DateTime {
  227.         return $this->deleteDate;
  228.     }
  229.     /**
  230.      * @return \DateTime
  231.      */
  232.     public function getInitialActivationDate(): \DateTime {
  233.         return $this->initialActivationDate;
  234.     }
  235.     /**
  236.      * @return \DateTime
  237.      */
  238.     public function getFinalActivationDate(): \DateTime {
  239.         return $this->finalActivationDate;
  240.     }
  241.     /**
  242.      * @return \App\Entity\TypePtsGenericDefinitionRules
  243.      */
  244.     public function getBasicDefinition(): \App\Entity\TypePtsGenericDefinitionRules {
  245.         return $this->basicDefinition;
  246.     }
  247.     /**
  248.      * @return \App\Entity\PtsAdquiRedemRules
  249.      */
  250.     public function getParentDefinition() {
  251.         return $this->parentDefinition;
  252.     }
  253.     /**
  254.      * @return \App\Entity\AccountLicense
  255.      */
  256.     public function getLicense(): \App\Entity\AccountLicense {
  257.         return $this->license;
  258.     }
  259.     /**
  260.      * @param type $id
  261.      */
  262.     public function setId($id) {
  263.         $this->id $id;
  264.     }
  265.     /**
  266.      * @param type $name
  267.      */
  268.     public function setName($name) {
  269.         $this->name $name;
  270.     }
  271.     /**
  272.      * @param type $ptsRate
  273.      */
  274.     public function setPtsRate($ptsRate) {
  275.         $this->ptsRate $ptsRate;
  276.     }
  277.     /**
  278.      * @param type $watchableObject
  279.      */
  280.     public function setWatchableObject($watchableObject) {
  281.         $this->watchableObject $watchableObject;
  282.     }
  283.     /**
  284.      * @param type $applyToSpecificRecord
  285.      */
  286.     public function setApplyToSpecificRecord($applyToSpecificRecord) {
  287.         $this->applyToSpecificRecord $applyToSpecificRecord;
  288.     }
  289.     /**
  290.      * @param type $justClaimOnce
  291.      */
  292.     public function setJustClaimOnce($justClaimOnce) {
  293.         $this->justClaimOnce $justClaimOnce;
  294.     }
  295.     /**
  296.      * @param \DateTime $creationDate
  297.      */
  298.     public function setCreationDate(\DateTime $creationDate) {
  299.         $this->creationDate $creationDate;
  300.     }
  301.     /**
  302.      * @param \DateTime $updateDate
  303.      */
  304.     public function setUpdateDate(\DateTime $updateDate null) {
  305.         $this->updateDate $updateDate;
  306.     }
  307.     /**
  308.      * @param \DateTime $deleteDate
  309.      */
  310.     public function setDeleteDate(\DateTime $deleteDate null) {
  311.         $this->deleteDate $deleteDate;
  312.     }
  313.     /**
  314.      * @param \DateTime $initialActivationDate
  315.      */
  316.     public function setInitialActivationDate(\DateTime $initialActivationDate) {
  317.         $this->initialActivationDate $initialActivationDate;
  318.     }
  319.     /**
  320.      * @param \DateTime $finalActivationDate
  321.      */
  322.     public function setFinalActivationDate(\DateTime $finalActivationDate null) {
  323.         $this->finalActivationDate $finalActivationDate;
  324.     }
  325.     /**
  326.      * @param \App\Entity\TypePtsGenericDefinitionRules $basicDefinition
  327.      */
  328.     public function setBasicDefinition(\App\Entity\TypePtsGenericDefinitionRules $basicDefinition) {
  329.         $this->basicDefinition $basicDefinition;
  330.     }
  331.     /**
  332.      * @param \App\Entity\PtsAdquiRedemRules $parentDefinition
  333.      */
  334.     public function setParentDefinition(\App\Entity\PtsAdquiRedemRules $parentDefinition null) {
  335.         $this->parentDefinition $parentDefinition;
  336.     }
  337.     /**
  338.      * @param \App\Entity\AccountLicense $license
  339.      */
  340.     public function setLicense(\App\Entity\AccountLicense $license null) {
  341.         $this->license $license;
  342.     }
  343.     /**
  344.      * @ORM\PrePersist
  345.      */
  346.     public function syncPrePersist() {
  347.         if (!$this->id) {
  348.             $newUUID UUIDGeneratorUtil::getUUIDv4();
  349.             $this->setId($newUUID);
  350.         }
  351.     }
  352.     /**
  353.      * @return type
  354.      */
  355.     public function showEverything() {
  356.         return get_object_vars($this);
  357.     }
  358.     /**
  359.      * @return type
  360.      */
  361.     public function __toString() {
  362.         return $this->name;
  363.     }
  364.     
  365. }