<?php
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
use App\Util\UUIDGeneratorUtil;
use Doctrine\Common\Persistence\Event\LifecycleEventArgs;
/**
* PointAcount
* @ORM\Table(name="point_acount")
* @ORM\Entity(repositoryClass="App\Repository\PointAcountRepository")
* @ORM\HasLifecycleCallbacks
*/
class PointAcount {
const SORT = 0;
/**
* @var integer
* @ORM\Column(name="pa_id", type="guid")
* @ORM\Id
* @ORM\GeneratedValue(strategy="NONE")
*/
private $id;
/**
* @var string
* Foranea blanda con OmtClient
* @ORM\Column(name="pa_omt_client_fk", type="string", nullable=false)
*/
private $omtClient;
/**
* @var string
* @ORM\Column(name="pa_base_point_acount_token", type="string", unique=true)
*/
private $basePointacount;
/**
* @var \DateTime
* @ORM\Column(name="pa_activation_date", type="datetime")
*/
private $activationDate;
/**
* @var string
* @ORM\Column(name="pa_blocked_other_transaction", type="boolean", nullable=true)
*/
private $isBlockedByOtherTransaction;
/**
* @return type
*/
public function getId() {
return $this->id;
}
/**
* @return type
*/
public function getIsBlockedByOtherTransaction() {
return $this->isBlockedByOtherTransaction;
}
/**
* @param type $isBlockedByOtherTransaction
*/
public function setIsBlockedByOtherTransaction($isBlockedByOtherTransaction) {
$this->isBlockedByOtherTransaction = $isBlockedByOtherTransaction;
}
/**
* @return type
*/
public function getBasePointacount() {
return $this->basePointacount;
}
/**
* @return \DateTime
*/
public function getActivationDate(): \DateTime {
return $this->activationDate;
}
/**
* @param type $id
*/
public function setId($id) {
$this->id = $id;
}
/**
* @param type $basePointacount
*/
public function setBasePointacount($basePointacount) {
$this->basePointacount = $basePointacount;
}
/**
* @param \DateTime $activationDate
*/
public function setActivationDate(\DateTime $activationDate) {
$this->activationDate = $activationDate;
}
/**
* @ORM\PrePersist
*/
public function syncPrePersist() {
if (!$this->id) {
$newUUID = UUIDGeneratorUtil::getUUIDv4();
$this->setId($newUUID);
}
}
/**
* Esta funcion permite construir la condicion de ordenamiento acorde a
* los parametros ingresados por el usuario
* @author Luis Enrique Robledo Lopez - Kijho Technologies
* @param string $alias
* @param array[string] $order
* @return string cadena para concatenar a la consulta
*/
public static function filterOrderParameters($alias, $order, $search = []) {
$orderBy = '';
if (isset($order['order_by']) && $order['order_by'] != '') {
if ($order['order_by'] == "name" && $order['sort'] == static::SORT) {
$orderBy = ' ORDER BY ' . $alias . '.omtClient ASC ';
} elseif ($order['order_by'] == "name") {
$orderBy = ' ORDER BY ' . $alias . '.omtClient DESC ';
}
}
return $orderBy;
}
/**
* Get foranea blanda con OmtClient
*/
public function getOmtClient(): string{
return $this->omtClient;
}
/**
* Set foranea blanda con OmtClient
*/
public function setOmtClient(string $omtClient){
$this->omtClient = $omtClient;
}
}