src/Entity/TypePointAcount.php line 17

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. use App\Util\UUIDGeneratorUtil;
  5. use Doctrine\ORM\Mapping\MappedSuperclass;
  6. use Doctrine\ORM\Mapping\HasLifecycleCallbacks;
  7. /**
  8.  * TypePointAcount
  9.  * @ORM\Table(name="type_point_acount")
  10.  * @ORM\Entity(repositoryClass="App\Repository\TypePointAcountRepository")
  11.  * @MappedSuperclass
  12.  * @HasLifecycleCallbacks
  13.  */
  14. class TypePointAcount {
  15.     /**
  16.      * @var integer
  17.      * @ORM\Column(name="tpa_id", type="guid")
  18.      * @ORM\Id
  19.      * @ORM\GeneratedValue(strategy="NONE")
  20.      */
  21.     private $id;
  22.     /**
  23.      * @var \App\Entity\TypePoint
  24.      * @ORM\ManyToOne(targetEntity="App\Entity\TypePoint")
  25.      * @ORM\JoinColumns({
  26.      *      @ORM\JoinColumn(name="tpa_type_point_fk", referencedColumnName="tp_id", onDelete="CASCADE")
  27.      * })
  28.      */
  29.     private $typePoint;
  30.     /**
  31.      * @var \App\Entity\PointAcount
  32.      * @ORM\ManyToOne(targetEntity="App\Entity\PointAcount")
  33.      * @ORM\JoinColumns({
  34.      *      @ORM\JoinColumn(name="tpa_point_acount_fk", referencedColumnName="pa_id", onDelete="CASCADE")
  35.      * })
  36.      */
  37.     private $pointAcount;
  38.     /**
  39.      * @var decimal
  40.      * @ORM\Column(name="tpa_pt_amount", type="decimal", precision=10, scale=2)
  41.      */
  42.     private $amount 0;
  43.     /**
  44.      * @var \DateTime
  45.      * @ORM\Column(name="tpa_starting_date", type="datetime")
  46.      */
  47.     private $startingDate;
  48.     /**
  49.      * @var \App\Entity\Country
  50.      * @ORM\ManyToOne(targetEntity="App\Entity\Country")
  51.      * @ORM\JoinColumns({
  52.      *      @ORM\JoinColumn(name="tpa_country_fk", referencedColumnName="co_id") 
  53.      * })
  54.      */
  55.     private $countryId;
  56.     /**
  57.      * @var string
  58.      * @ORM\Column(name="tpa_point_arm_acount", type="string")
  59.      */
  60.     private $pointArmAcount;
  61.     /**
  62.      * @var string
  63.      * @ORM\Column(name="tpa_specific_acount_token", type="string", unique=true)
  64.      */
  65.     private $acountToken;
  66.     
  67.     /**
  68.      * @var string
  69.      * @ORM\Column(name="tpa_arm_identifier", type="string", nullable=true, unique=true)
  70.      */
  71.     private $armIdentifier;
  72.     
  73.     /**
  74.      * @var string
  75.      * @ORM\Column(name="tpa_transaction_verification_token", type="string", nullable=true, unique=true)
  76.      */
  77.     private $transactionVerificationToken;
  78.     /**
  79.      * @var \DateTime
  80.      * @ORM\Column(name="tpa_verification_token_created_date", type="datetime", nullable=true)
  81.     */
  82.     private $verificationTokenCreatedDate;
  83.     
  84.     /**
  85.      * @var \App\Entity\AccountLicense
  86.      * @ORM\ManyToOne(targetEntity="App\Entity\AccountLicense")
  87.      * @ORM\JoinColumns({
  88.      *   @ORM\JoinColumn(name="tpa_license", referencedColumnName="al_id", nullable=true, onDelete="CASCADE")
  89.      * })
  90.      */
  91.     private $license;
  92.     /**
  93.      * @return type
  94.      */
  95.     public function getId() {
  96.         return $this->id;
  97.     }
  98.     /**
  99.      * @return \App\Entity\AccountLicense
  100.      */
  101.     public function getLicense() {
  102.         return $this->license;
  103.     }
  104.     /**
  105.      * @param \App\Entity\AccountLicense $license
  106.      */
  107.     public function setLicense(\App\Entity\AccountLicense $license null) {
  108.         $this->license $license;
  109.     }
  110.         
  111.     /**
  112.      * @return type
  113.      */
  114.     public function getArmIdentifier() {
  115.         return $this->armIdentifier;
  116.     }
  117.     /**
  118.      * @param type $armIdentifier
  119.      */
  120.     public function setArmIdentifier($armIdentifier) {
  121.         $this->armIdentifier $armIdentifier;
  122.     }
  123.         
  124.     /**
  125.      * @return \App\Entity\TypePoint
  126.      */
  127.     public function getTypePoint(): \App\Entity\TypePoint {
  128.         return $this->typePoint;
  129.     }
  130.     /**
  131.      * @return \App\Entity\PointAcount
  132.      */
  133.     public function getPointAcount(): \App\Entity\PointAcount {
  134.         return $this->pointAcount;
  135.     }
  136.     /**
  137.      * @return type
  138.      */
  139.     public function getAmount() {
  140.         return $this->amount;
  141.     }
  142.     /**
  143.      * @return \DateTime
  144.      */
  145.     public function getStartingDate(): \DateTime {
  146.         return $this->startingDate;
  147.     }
  148.     /**
  149.      * @return \App\Entity\Country
  150.      */
  151.     public function getCountryId(): \App\Entity\Country {
  152.         return $this->countryId;
  153.     }
  154.     /**
  155.      * @return type
  156.      */
  157.     public function getPointArmAcount() {
  158.         return $this->pointArmAcount;
  159.     }
  160.     /**
  161.      * @return type
  162.      */
  163.     public function getAcountToken() {
  164.         return $this->acountToken;
  165.     }
  166.     /**
  167.      * @param type $id
  168.      */
  169.     public function setId($id) {
  170.         $this->id $id;
  171.     }
  172.     /**
  173.      * @param \App\Entity\TypePoint $typePoint
  174.      */
  175.     public function setTypePoint(\App\Entity\TypePoint $typePoint) {
  176.         $this->typePoint $typePoint;
  177.     }
  178.     /**
  179.      * @param \App\Entity\PointAcount $pointAcount
  180.      */
  181.     public function setPointAcount(\App\Entity\PointAcount $pointAcount) {
  182.         $this->pointAcount $pointAcount;
  183.     }
  184.     /**
  185.      * @param type $amount
  186.      */
  187.     public function setAmount($amount) {
  188.         $this->amount $amount;
  189.     }
  190.     /**
  191.      * @param \DateTime $startingDate
  192.      */
  193.     public function setStartingDate(\DateTime $startingDate) {
  194.         $this->startingDate $startingDate;
  195.     }
  196.     /**
  197.      * @param \App\Entity\Country $countryId
  198.      */
  199.     public function setCountryId(\App\Entity\Country $countryId) {
  200.         $this->countryId $countryId;
  201.     }
  202.     /**
  203.      * @param type $pointArmAcount
  204.      */
  205.     public function setPointArmAcount($pointArmAcount) {
  206.         $this->pointArmAcount $pointArmAcount;
  207.     }
  208.     /**
  209.      * @param type $acountToken
  210.      */
  211.     public function setAcountToken($acountToken) {
  212.         $this->acountToken $acountToken;
  213.     }
  214.     /**
  215.      * @return type
  216.      */
  217.     public function showEverything() {
  218.         return get_object_vars($this);
  219.     }
  220.     /**
  221.      * @ORM\PrePersist
  222.      */
  223.     public function syncPrePersist() {
  224.         if (!$this->id) {
  225.             $newUUID UUIDGeneratorUtil::getUUIDv4();
  226.             $this->setId($newUUID);
  227.         }
  228.     }
  229.     /**
  230.      * @return  string
  231.      */ 
  232.     public function getTransactionVerificationToken()
  233.     {
  234.         return $this->transactionVerificationToken;
  235.     }
  236.     /**
  237.      * @param  string  $transactionVerificationToken
  238.      */ 
  239.     public function setTransactionVerificationToken($transactionVerificationToken)
  240.     {
  241.         $this->transactionVerificationToken $transactionVerificationToken;
  242.     }
  243.     /**
  244.      * @return  \DateTime
  245.      */ 
  246.     public function getVerificationTokenCreatedDate()
  247.     {
  248.         return $this->verificationTokenCreatedDate;
  249.     }
  250.     /**
  251.      * @param  \DateTime  $verificationTokenCreatedDate
  252.      */ 
  253.     public function setVerificationTokenCreatedDate($verificationTokenCreatedDate)
  254.     {
  255.         $this->verificationTokenCreatedDate $verificationTokenCreatedDate;
  256.     }
  257.     /**
  258.      * Funcion para realizar el filtrado de parametros de busqueda
  259.      * correspondientes a esta entidad
  260.      * @author Aealan Z <lrobledo@kijho.com> 29/07/2016
  261.      * @param type $alias salchichas y mucho mas
  262.      * @param type $search arreglo con los parametros de busqueda a filtrar
  263.      * correspondientes a la entidad
  264.      * @return type un arreglo con un arreglo que contiene los parametros de
  265.      * busqueda filtrados para una consulta y un string que sera parte del DQL
  266.      * que realizara la busqueda correspondiente de las entidades en la base
  267.      * de datos
  268.      */
  269.     public static function filterSearchParameters($alias = ['TypePointAcount' => 'tpa'], $search) {
  270.         $textParameters '';
  271.         $parameters = [];
  272.         if (isset($search['restaurant'])) {
  273.             $textParameters .= " AND (" $alias['TypePointAcount'] . ".license = :restaurant OR " $alias['TypePointAcount'] . ".license IS NULL) ";
  274.             $parameters['restaurant'] = $search['restaurant'];
  275.         }
  276.         return ['text' => $textParameters'parameters' => $parameters];
  277.     }
  278. }