src/Entity/PointAcount.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. use Doctrine\Common\Persistence\Event\LifecycleEventArgs;
  6. /**
  7.  * PointAcount
  8.  * @ORM\Table(name="point_acount")
  9.  * @ORM\Entity(repositoryClass="App\Repository\PointAcountRepository")
  10.  * @ORM\HasLifecycleCallbacks
  11.  */
  12. class PointAcount {
  13.     const SORT 0;
  14.     /**
  15.      * @var integer
  16.      * @ORM\Column(name="pa_id", type="guid")
  17.      * @ORM\Id
  18.      * @ORM\GeneratedValue(strategy="NONE")
  19.      */
  20.     private $id;
  21.     /**
  22.      * @var string
  23.      * Foranea blanda con OmtClient
  24.      * @ORM\Column(name="pa_omt_client_fk", type="string", nullable=false)
  25.      */
  26.     private $omtClient;
  27.     /**
  28.      * @var string
  29.      * @ORM\Column(name="pa_base_point_acount_token", type="string", unique=true)
  30.      */
  31.     private $basePointacount;
  32.     /**
  33.      * @var \DateTime
  34.      * @ORM\Column(name="pa_activation_date", type="datetime")
  35.      */
  36.     private $activationDate;
  37.     
  38.     /**
  39.      * @var string
  40.      * @ORM\Column(name="pa_blocked_other_transaction", type="boolean", nullable=true)
  41.      */
  42.     private $isBlockedByOtherTransaction;
  43.     /**
  44.      * @return type
  45.      */
  46.     public function getId() {
  47.         return $this->id;
  48.     }
  49.     /**
  50.      * @return type
  51.      */
  52.     public function getIsBlockedByOtherTransaction() {
  53.         return $this->isBlockedByOtherTransaction;
  54.     }
  55.     /**
  56.      * @param type $isBlockedByOtherTransaction
  57.      */
  58.     public function setIsBlockedByOtherTransaction($isBlockedByOtherTransaction) {
  59.         $this->isBlockedByOtherTransaction $isBlockedByOtherTransaction;
  60.     }
  61.     /**
  62.      * @return type
  63.      */
  64.     public function getBasePointacount() {
  65.         return $this->basePointacount;
  66.     }
  67.     /**
  68.      * @return \DateTime
  69.      */
  70.     public function getActivationDate(): \DateTime {
  71.         return $this->activationDate;
  72.     }
  73.     /**
  74.      * @param type $id
  75.      */
  76.     public function setId($id) {
  77.         $this->id $id;
  78.     }
  79.     /**
  80.      * @param type $basePointacount
  81.      */
  82.     public function setBasePointacount($basePointacount) {
  83.         $this->basePointacount $basePointacount;
  84.     }
  85.     /**
  86.      * @param \DateTime $activationDate
  87.      */
  88.     public function setActivationDate(\DateTime $activationDate) {
  89.         $this->activationDate $activationDate;
  90.     }
  91.     /**
  92.      * @ORM\PrePersist
  93.      */
  94.     public function syncPrePersist() {
  95.         if (!$this->id) {
  96.             $newUUID UUIDGeneratorUtil::getUUIDv4();
  97.             $this->setId($newUUID);
  98.         }
  99.     }
  100.     /**
  101.      * Esta funcion permite construir la condicion de ordenamiento acorde a
  102.      * los parametros ingresados por el usuario
  103.      * @author Luis Enrique Robledo Lopez - Kijho Technologies
  104.      * @param string $alias
  105.      * @param array[string] $order
  106.      * @return string cadena para concatenar a la consulta
  107.      */
  108.     public static function filterOrderParameters($alias$order$search = []) {
  109.         $orderBy '';
  110.         if (isset($order['order_by']) && $order['order_by'] != '') {
  111.             if ($order['order_by'] == "name" && $order['sort'] == static::SORT) {
  112.                 $orderBy ' ORDER BY ' $alias '.omtClient ASC ';
  113.             } elseif ($order['order_by'] == "name") {
  114.                 $orderBy ' ORDER BY ' $alias '.omtClient DESC ';
  115.             } 
  116.         }
  117.         return $orderBy;
  118.     }
  119.     /**
  120.      * Get foranea blanda con OmtClient
  121.      */
  122.     public function getOmtClient(): string{
  123.         return $this->omtClient;
  124.     }
  125.     /**
  126.      * Set foranea blanda con OmtClient
  127.      */
  128.     public function setOmtClient(string $omtClient){
  129.         $this->omtClient $omtClient;
  130.     }
  131. }