<?php
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
use App\Util\UUIDGeneratorUtil;
use Doctrine\ORM\Mapping\MappedSuperclass;
use Doctrine\ORM\Mapping\HasLifecycleCallbacks;
/**
* TypePointAcount
* @ORM\Table(name="type_point_acount")
* @ORM\Entity(repositoryClass="App\Repository\TypePointAcountRepository")
* @MappedSuperclass
* @HasLifecycleCallbacks
*/
class TypePointAcount {
/**
* @var integer
* @ORM\Column(name="tpa_id", type="guid")
* @ORM\Id
* @ORM\GeneratedValue(strategy="NONE")
*/
private $id;
/**
* @var \App\Entity\TypePoint
* @ORM\ManyToOne(targetEntity="App\Entity\TypePoint")
* @ORM\JoinColumns({
* @ORM\JoinColumn(name="tpa_type_point_fk", referencedColumnName="tp_id", onDelete="CASCADE")
* })
*/
private $typePoint;
/**
* @var \App\Entity\PointAcount
* @ORM\ManyToOne(targetEntity="App\Entity\PointAcount")
* @ORM\JoinColumns({
* @ORM\JoinColumn(name="tpa_point_acount_fk", referencedColumnName="pa_id", onDelete="CASCADE")
* })
*/
private $pointAcount;
/**
* @var decimal
* @ORM\Column(name="tpa_pt_amount", type="decimal", precision=10, scale=2)
*/
private $amount = 0;
/**
* @var \DateTime
* @ORM\Column(name="tpa_starting_date", type="datetime")
*/
private $startingDate;
/**
* @var \App\Entity\Country
* @ORM\ManyToOne(targetEntity="App\Entity\Country")
* @ORM\JoinColumns({
* @ORM\JoinColumn(name="tpa_country_fk", referencedColumnName="co_id")
* })
*/
private $countryId;
/**
* @var string
* @ORM\Column(name="tpa_point_arm_acount", type="string")
*/
private $pointArmAcount;
/**
* @var string
* @ORM\Column(name="tpa_specific_acount_token", type="string", unique=true)
*/
private $acountToken;
/**
* @var string
* @ORM\Column(name="tpa_arm_identifier", type="string", nullable=true, unique=true)
*/
private $armIdentifier;
/**
* @var string
* @ORM\Column(name="tpa_transaction_verification_token", type="string", nullable=true, unique=true)
*/
private $transactionVerificationToken;
/**
* @var \DateTime
* @ORM\Column(name="tpa_verification_token_created_date", type="datetime", nullable=true)
*/
private $verificationTokenCreatedDate;
/**
* @var \App\Entity\AccountLicense
* @ORM\ManyToOne(targetEntity="App\Entity\AccountLicense")
* @ORM\JoinColumns({
* @ORM\JoinColumn(name="tpa_license", referencedColumnName="al_id", nullable=true, onDelete="CASCADE")
* })
*/
private $license;
/**
* @return type
*/
public function getId() {
return $this->id;
}
/**
* @return \App\Entity\AccountLicense
*/
public function getLicense() {
return $this->license;
}
/**
* @param \App\Entity\AccountLicense $license
*/
public function setLicense(\App\Entity\AccountLicense $license = null) {
$this->license = $license;
}
/**
* @return type
*/
public function getArmIdentifier() {
return $this->armIdentifier;
}
/**
* @param type $armIdentifier
*/
public function setArmIdentifier($armIdentifier) {
$this->armIdentifier = $armIdentifier;
}
/**
* @return \App\Entity\TypePoint
*/
public function getTypePoint(): \App\Entity\TypePoint {
return $this->typePoint;
}
/**
* @return \App\Entity\PointAcount
*/
public function getPointAcount(): \App\Entity\PointAcount {
return $this->pointAcount;
}
/**
* @return type
*/
public function getAmount() {
return $this->amount;
}
/**
* @return \DateTime
*/
public function getStartingDate(): \DateTime {
return $this->startingDate;
}
/**
* @return \App\Entity\Country
*/
public function getCountryId(): \App\Entity\Country {
return $this->countryId;
}
/**
* @return type
*/
public function getPointArmAcount() {
return $this->pointArmAcount;
}
/**
* @return type
*/
public function getAcountToken() {
return $this->acountToken;
}
/**
* @param type $id
*/
public function setId($id) {
$this->id = $id;
}
/**
* @param \App\Entity\TypePoint $typePoint
*/
public function setTypePoint(\App\Entity\TypePoint $typePoint) {
$this->typePoint = $typePoint;
}
/**
* @param \App\Entity\PointAcount $pointAcount
*/
public function setPointAcount(\App\Entity\PointAcount $pointAcount) {
$this->pointAcount = $pointAcount;
}
/**
* @param type $amount
*/
public function setAmount($amount) {
$this->amount = $amount;
}
/**
* @param \DateTime $startingDate
*/
public function setStartingDate(\DateTime $startingDate) {
$this->startingDate = $startingDate;
}
/**
* @param \App\Entity\Country $countryId
*/
public function setCountryId(\App\Entity\Country $countryId) {
$this->countryId = $countryId;
}
/**
* @param type $pointArmAcount
*/
public function setPointArmAcount($pointArmAcount) {
$this->pointArmAcount = $pointArmAcount;
}
/**
* @param type $acountToken
*/
public function setAcountToken($acountToken) {
$this->acountToken = $acountToken;
}
/**
* @return type
*/
public function showEverything() {
return get_object_vars($this);
}
/**
* @ORM\PrePersist
*/
public function syncPrePersist() {
if (!$this->id) {
$newUUID = UUIDGeneratorUtil::getUUIDv4();
$this->setId($newUUID);
}
}
/**
* @return string
*/
public function getTransactionVerificationToken()
{
return $this->transactionVerificationToken;
}
/**
* @param string $transactionVerificationToken
*/
public function setTransactionVerificationToken($transactionVerificationToken)
{
$this->transactionVerificationToken = $transactionVerificationToken;
}
/**
* @return \DateTime
*/
public function getVerificationTokenCreatedDate()
{
return $this->verificationTokenCreatedDate;
}
/**
* @param \DateTime $verificationTokenCreatedDate
*/
public function setVerificationTokenCreatedDate($verificationTokenCreatedDate)
{
$this->verificationTokenCreatedDate = $verificationTokenCreatedDate;
}
/**
* Funcion para realizar el filtrado de parametros de busqueda
* correspondientes a esta entidad
* @author Aealan Z <lrobledo@kijho.com> 29/07/2016
* @param type $alias salchichas y mucho mas
* @param type $search arreglo con los parametros de busqueda a filtrar
* correspondientes a la entidad
* @return type un arreglo con un arreglo que contiene los parametros de
* busqueda filtrados para una consulta y un string que sera parte del DQL
* que realizara la busqueda correspondiente de las entidades en la base
* de datos
*/
public static function filterSearchParameters($alias = ['TypePointAcount' => 'tpa'], $search) {
$textParameters = '';
$parameters = [];
if (isset($search['restaurant'])) {
$textParameters .= " AND (" . $alias['TypePointAcount'] . ".license = :restaurant OR " . $alias['TypePointAcount'] . ".license IS NULL) ";
$parameters['restaurant'] = $search['restaurant'];
}
return ['text' => $textParameters, 'parameters' => $parameters];
}
}