/sgl/includes/model/generated/LicenciaGen.class.php
PHP | 1457 lines | 710 code | 190 blank | 557 comment | 121 complexity | e9c253c726465692570462902c53f226 MD5 | raw file
Possible License(s): LGPL-2.1, GPL-2.0
Large files files are truncated, but you can click here to view the full file
- <?php
- /**
- * The abstract LicenciaGen class defined here is
- * code-generated and contains all the basic CRUD-type functionality as well as
- * basic methods to handle relationships and index-based loading.
- *
- * To use, you should use the Licencia subclass which
- * extends this LicenciaGen class.
- *
- * Because subsequent re-code generations will overwrite any changes to this
- * file, you should leave this file unaltered to prevent yourself from losing
- * any information or code changes. All customizations should be done by
- * overriding existing or implementing new methods, properties and variables
- * in the Licencia class.
- *
- * @package My QCubed Application
- * @subpackage GeneratedDataObjects
- * @property-read integer $IdLICENCIA the value for intIdLICENCIA (Read-Only PK)
- * @property integer $EMPRESAIdEMPRESA the value for intEMPRESAIdEMPRESA (Not Null)
- * @property integer $PROVEEDORIdPROVEEDOR the value for intPROVEEDORIdPROVEEDOR (Not Null)
- * @property QDateTime $FechaInicio the value for dttFechaInicio (Not Null)
- * @property QDateTime $FechaFin the value for dttFechaFin
- * @property QDateTime $FechaFinEstimada the value for dttFechaFinEstimada
- * @property string $NumeroProforma the value for strNumeroProforma
- * @property string $NumeroCNP the value for strNumeroCNP
- * @property QDateTime $VencimientoCNP the value for dttVencimientoCNP
- * @property string $Status the value for strStatus (Not Null)
- * @property string $FormaPago the value for strFormaPago
- * @property string $Tipo the value for strTipo
- * @property double $Flete the value for fltFlete
- * @property string $Seguro the value for strSeguro
- * @property integer $PROCESOIdPROCESO the value for intPROCESOIdPROCESO (Not Null)
- * @property Empresa $EMPRESAIdEMPRESAObject the value for the Empresa object referenced by intEMPRESAIdEMPRESA (Not Null)
- * @property Proveedor $PROVEEDORIdPROVEEDORObject the value for the Proveedor object referenced by intPROVEEDORIdPROVEEDOR (Not Null)
- * @property Proceso $PROCESOIdPROCESOObject the value for the Proceso object referenced by intPROCESOIdPROCESO (Not Null)
- * @property-read CodigoPago $_CodigoPagoAsLICENCIAIdLICENCIA the value for the private _objCodigoPagoAsLICENCIAIdLICENCIA (Read-Only) if set due to an expansion on the CODIGO_PAGO.LICENCIA_idLICENCIA reverse relationship
- * @property-read CodigoPago[] $_CodigoPagoAsLICENCIAIdLICENCIAArray the value for the private _objCodigoPagoAsLICENCIAIdLICENCIAArray (Read-Only) if set due to an ExpandAsArray on the CODIGO_PAGO.LICENCIA_idLICENCIA reverse relationship
- * @property-read FaseLicencia $_FaseLicenciaAsLICENCIAIdLICENCIA the value for the private _objFaseLicenciaAsLICENCIAIdLICENCIA (Read-Only) if set due to an expansion on the FASE_LICENCIA.LICENCIA_idLICENCIA reverse relationship
- * @property-read FaseLicencia[] $_FaseLicenciaAsLICENCIAIdLICENCIAArray the value for the private _objFaseLicenciaAsLICENCIAIdLICENCIAArray (Read-Only) if set due to an ExpandAsArray on the FASE_LICENCIA.LICENCIA_idLICENCIA reverse relationship
- * @property-read Importacion $_ImportacionAsLICENCIAIdLICENCIA the value for the private _objImportacionAsLICENCIAIdLICENCIA (Read-Only) if set due to an expansion on the IMPORTACION.LICENCIA_idLICENCIA reverse relationship
- * @property-read Importacion[] $_ImportacionAsLICENCIAIdLICENCIAArray the value for the private _objImportacionAsLICENCIAIdLICENCIAArray (Read-Only) if set due to an ExpandAsArray on the IMPORTACION.LICENCIA_idLICENCIA reverse relationship
- * @property-read ListaProducto $_ListaProductoAsLICENCIAIdLICENCIA the value for the private _objListaProductoAsLICENCIAIdLICENCIA (Read-Only) if set due to an expansion on the LISTA_PRODUCTO.LICENCIA_idLICENCIA reverse relationship
- * @property-read ListaProducto[] $_ListaProductoAsLICENCIAIdLICENCIAArray the value for the private _objListaProductoAsLICENCIAIdLICENCIAArray (Read-Only) if set due to an ExpandAsArray on the LISTA_PRODUCTO.LICENCIA_idLICENCIA reverse relationship
- * @property-read Responsable $_ResponsableAsLICENCIAIdLICENCIA the value for the private _objResponsableAsLICENCIAIdLICENCIA (Read-Only) if set due to an expansion on the RESPONSABLE.LICENCIA_idLICENCIA reverse relationship
- * @property-read Responsable[] $_ResponsableAsLICENCIAIdLICENCIAArray the value for the private _objResponsableAsLICENCIAIdLICENCIAArray (Read-Only) if set due to an ExpandAsArray on the RESPONSABLE.LICENCIA_idLICENCIA reverse relationship
- * @property-read VigenciaDocumento $_VigenciaDocumentoAsLICENCIAIdLICENCIA the value for the private _objVigenciaDocumentoAsLICENCIAIdLICENCIA (Read-Only) if set due to an expansion on the VIGENCIA_DOCUMENTO.LICENCIA_idLICENCIA reverse relationship
- * @property-read VigenciaDocumento[] $_VigenciaDocumentoAsLICENCIAIdLICENCIAArray the value for the private _objVigenciaDocumentoAsLICENCIAIdLICENCIAArray (Read-Only) if set due to an ExpandAsArray on the VIGENCIA_DOCUMENTO.LICENCIA_idLICENCIA reverse relationship
- * @property-read boolean $__Restored whether or not this object was restored from the database (as opposed to created new)
- */
- class LicenciaGen extends QBaseClass implements IteratorAggregate {
- ///////////////////////////////////////////////////////////////////////
- // PROTECTED MEMBER VARIABLES and TEXT FIELD MAXLENGTHS (if applicable)
- ///////////////////////////////////////////////////////////////////////
-
- /**
- * Protected member variable that maps to the database PK Identity column LICENCIA.idLICENCIA
- * @var integer intIdLICENCIA
- */
- protected $intIdLICENCIA;
- const IdLICENCIADefault = null;
- /**
- * Protected member variable that maps to the database column LICENCIA.EMPRESA_idEMPRESA
- * @var integer intEMPRESAIdEMPRESA
- */
- protected $intEMPRESAIdEMPRESA;
- const EMPRESAIdEMPRESADefault = null;
- /**
- * Protected member variable that maps to the database column LICENCIA.PROVEEDOR_idPROVEEDOR
- * @var integer intPROVEEDORIdPROVEEDOR
- */
- protected $intPROVEEDORIdPROVEEDOR;
- const PROVEEDORIdPROVEEDORDefault = null;
- /**
- * Protected member variable that maps to the database column LICENCIA.fechaInicio
- * @var QDateTime dttFechaInicio
- */
- protected $dttFechaInicio;
- const FechaInicioDefault = null;
- /**
- * Protected member variable that maps to the database column LICENCIA.fechaFin
- * @var QDateTime dttFechaFin
- */
- protected $dttFechaFin;
- const FechaFinDefault = null;
- /**
- * Protected member variable that maps to the database column LICENCIA.fechaFinEstimada
- * @var QDateTime dttFechaFinEstimada
- */
- protected $dttFechaFinEstimada;
- const FechaFinEstimadaDefault = null;
- /**
- * Protected member variable that maps to the database column LICENCIA.numeroProforma
- * @var string strNumeroProforma
- */
- protected $strNumeroProforma;
- const NumeroProformaMaxLength = 45;
- const NumeroProformaDefault = null;
- /**
- * Protected member variable that maps to the database column LICENCIA.numeroCNP
- * @var string strNumeroCNP
- */
- protected $strNumeroCNP;
- const NumeroCNPMaxLength = 45;
- const NumeroCNPDefault = null;
- /**
- * Protected member variable that maps to the database column LICENCIA.vencimientoCNP
- * @var QDateTime dttVencimientoCNP
- */
- protected $dttVencimientoCNP;
- const VencimientoCNPDefault = null;
- /**
- * Protected member variable that maps to the database column LICENCIA.status
- * @var string strStatus
- */
- protected $strStatus;
- const StatusMaxLength = 45;
- const StatusDefault = null;
- /**
- * Protected member variable that maps to the database column LICENCIA.formaPago
- * @var string strFormaPago
- */
- protected $strFormaPago;
- const FormaPagoMaxLength = 45;
- const FormaPagoDefault = null;
- /**
- * Protected member variable that maps to the database column LICENCIA.tipo
- * @var string strTipo
- */
- protected $strTipo;
- const TipoMaxLength = 45;
- const TipoDefault = null;
- /**
- * Protected member variable that maps to the database column LICENCIA.flete
- * @var double fltFlete
- */
- protected $fltFlete;
- const FleteDefault = null;
- /**
- * Protected member variable that maps to the database column LICENCIA.seguro
- * @var string strSeguro
- */
- protected $strSeguro;
- const SeguroMaxLength = 45;
- const SeguroDefault = null;
- /**
- * Protected member variable that maps to the database column LICENCIA.PROCESO_idPROCESO
- * @var integer intPROCESOIdPROCESO
- */
- protected $intPROCESOIdPROCESO;
- const PROCESOIdPROCESODefault = null;
- /**
- * Private member variable that stores a reference to a single CodigoPagoAsLICENCIAIdLICENCIA object
- * (of type CodigoPago), if this Licencia object was restored with
- * an expansion on the CODIGO_PAGO association table.
- * @var CodigoPago _objCodigoPagoAsLICENCIAIdLICENCIA;
- */
- private $_objCodigoPagoAsLICENCIAIdLICENCIA;
- /**
- * Private member variable that stores a reference to an array of CodigoPagoAsLICENCIAIdLICENCIA objects
- * (of type CodigoPago[]), if this Licencia object was restored with
- * an ExpandAsArray on the CODIGO_PAGO association table.
- * @var CodigoPago[] _objCodigoPagoAsLICENCIAIdLICENCIAArray;
- */
- private $_objCodigoPagoAsLICENCIAIdLICENCIAArray = array();
- /**
- * Private member variable that stores a reference to a single FaseLicenciaAsLICENCIAIdLICENCIA object
- * (of type FaseLicencia), if this Licencia object was restored with
- * an expansion on the FASE_LICENCIA association table.
- * @var FaseLicencia _objFaseLicenciaAsLICENCIAIdLICENCIA;
- */
- private $_objFaseLicenciaAsLICENCIAIdLICENCIA;
- /**
- * Private member variable that stores a reference to an array of FaseLicenciaAsLICENCIAIdLICENCIA objects
- * (of type FaseLicencia[]), if this Licencia object was restored with
- * an ExpandAsArray on the FASE_LICENCIA association table.
- * @var FaseLicencia[] _objFaseLicenciaAsLICENCIAIdLICENCIAArray;
- */
- private $_objFaseLicenciaAsLICENCIAIdLICENCIAArray = array();
- /**
- * Private member variable that stores a reference to a single ImportacionAsLICENCIAIdLICENCIA object
- * (of type Importacion), if this Licencia object was restored with
- * an expansion on the IMPORTACION association table.
- * @var Importacion _objImportacionAsLICENCIAIdLICENCIA;
- */
- private $_objImportacionAsLICENCIAIdLICENCIA;
- /**
- * Private member variable that stores a reference to an array of ImportacionAsLICENCIAIdLICENCIA objects
- * (of type Importacion[]), if this Licencia object was restored with
- * an ExpandAsArray on the IMPORTACION association table.
- * @var Importacion[] _objImportacionAsLICENCIAIdLICENCIAArray;
- */
- private $_objImportacionAsLICENCIAIdLICENCIAArray = array();
- /**
- * Private member variable that stores a reference to a single ListaProductoAsLICENCIAIdLICENCIA object
- * (of type ListaProducto), if this Licencia object was restored with
- * an expansion on the LISTA_PRODUCTO association table.
- * @var ListaProducto _objListaProductoAsLICENCIAIdLICENCIA;
- */
- private $_objListaProductoAsLICENCIAIdLICENCIA;
- /**
- * Private member variable that stores a reference to an array of ListaProductoAsLICENCIAIdLICENCIA objects
- * (of type ListaProducto[]), if this Licencia object was restored with
- * an ExpandAsArray on the LISTA_PRODUCTO association table.
- * @var ListaProducto[] _objListaProductoAsLICENCIAIdLICENCIAArray;
- */
- private $_objListaProductoAsLICENCIAIdLICENCIAArray = array();
- /**
- * Private member variable that stores a reference to a single ResponsableAsLICENCIAIdLICENCIA object
- * (of type Responsable), if this Licencia object was restored with
- * an expansion on the RESPONSABLE association table.
- * @var Responsable _objResponsableAsLICENCIAIdLICENCIA;
- */
- private $_objResponsableAsLICENCIAIdLICENCIA;
- /**
- * Private member variable that stores a reference to an array of ResponsableAsLICENCIAIdLICENCIA objects
- * (of type Responsable[]), if this Licencia object was restored with
- * an ExpandAsArray on the RESPONSABLE association table.
- * @var Responsable[] _objResponsableAsLICENCIAIdLICENCIAArray;
- */
- private $_objResponsableAsLICENCIAIdLICENCIAArray = array();
- /**
- * Private member variable that stores a reference to a single VigenciaDocumentoAsLICENCIAIdLICENCIA object
- * (of type VigenciaDocumento), if this Licencia object was restored with
- * an expansion on the VIGENCIA_DOCUMENTO association table.
- * @var VigenciaDocumento _objVigenciaDocumentoAsLICENCIAIdLICENCIA;
- */
- private $_objVigenciaDocumentoAsLICENCIAIdLICENCIA;
- /**
- * Private member variable that stores a reference to an array of VigenciaDocumentoAsLICENCIAIdLICENCIA objects
- * (of type VigenciaDocumento[]), if this Licencia object was restored with
- * an ExpandAsArray on the VIGENCIA_DOCUMENTO association table.
- * @var VigenciaDocumento[] _objVigenciaDocumentoAsLICENCIAIdLICENCIAArray;
- */
- private $_objVigenciaDocumentoAsLICENCIAIdLICENCIAArray = array();
- /**
- * Protected array of virtual attributes for this object (e.g. extra/other calculated and/or non-object bound
- * columns from the run-time database query result for this object). Used by InstantiateDbRow and
- * GetVirtualAttribute.
- * @var string[] $__strVirtualAttributeArray
- */
- protected $__strVirtualAttributeArray = array();
- /**
- * Protected internal member variable that specifies whether or not this object is Restored from the database.
- * Used by Save() to determine if Save() should perform a db UPDATE or INSERT.
- * @var bool __blnRestored;
- */
- protected $__blnRestored;
- ///////////////////////////////
- // PROTECTED MEMBER OBJECTS
- ///////////////////////////////
- /**
- * Protected member variable that contains the object pointed by the reference
- * in the database column LICENCIA.EMPRESA_idEMPRESA.
- *
- * NOTE: Always use the EMPRESAIdEMPRESAObject property getter to correctly retrieve this Empresa object.
- * (Because this class implements late binding, this variable reference MAY be null.)
- * @var Empresa objEMPRESAIdEMPRESAObject
- */
- protected $objEMPRESAIdEMPRESAObject;
- /**
- * Protected member variable that contains the object pointed by the reference
- * in the database column LICENCIA.PROVEEDOR_idPROVEEDOR.
- *
- * NOTE: Always use the PROVEEDORIdPROVEEDORObject property getter to correctly retrieve this Proveedor object.
- * (Because this class implements late binding, this variable reference MAY be null.)
- * @var Proveedor objPROVEEDORIdPROVEEDORObject
- */
- protected $objPROVEEDORIdPROVEEDORObject;
- /**
- * Protected member variable that contains the object pointed by the reference
- * in the database column LICENCIA.PROCESO_idPROCESO.
- *
- * NOTE: Always use the PROCESOIdPROCESOObject property getter to correctly retrieve this Proceso object.
- * (Because this class implements late binding, this variable reference MAY be null.)
- * @var Proceso objPROCESOIdPROCESOObject
- */
- protected $objPROCESOIdPROCESOObject;
- /**
- * Initialize each property with default values from database definition
- */
- public function Initialize()
- {
- $this->intIdLICENCIA = Licencia::IdLICENCIADefault;
- $this->intEMPRESAIdEMPRESA = Licencia::EMPRESAIdEMPRESADefault;
- $this->intPROVEEDORIdPROVEEDOR = Licencia::PROVEEDORIdPROVEEDORDefault;
- $this->dttFechaInicio = (Licencia::FechaInicioDefault === null)?null:new QDateTime(Licencia::FechaInicioDefault);
- $this->dttFechaFin = (Licencia::FechaFinDefault === null)?null:new QDateTime(Licencia::FechaFinDefault);
- $this->dttFechaFinEstimada = (Licencia::FechaFinEstimadaDefault === null)?null:new QDateTime(Licencia::FechaFinEstimadaDefault);
- $this->strNumeroProforma = Licencia::NumeroProformaDefault;
- $this->strNumeroCNP = Licencia::NumeroCNPDefault;
- $this->dttVencimientoCNP = (Licencia::VencimientoCNPDefault === null)?null:new QDateTime(Licencia::VencimientoCNPDefault);
- $this->strStatus = Licencia::StatusDefault;
- $this->strFormaPago = Licencia::FormaPagoDefault;
- $this->strTipo = Licencia::TipoDefault;
- $this->fltFlete = Licencia::FleteDefault;
- $this->strSeguro = Licencia::SeguroDefault;
- $this->intPROCESOIdPROCESO = Licencia::PROCESOIdPROCESODefault;
- }
- ///////////////////////////////
- // CLASS-WIDE LOAD AND COUNT METHODS
- ///////////////////////////////
- /**
- * Static method to retrieve the Database object that owns this class.
- * @return QDatabaseBase reference to the Database object that can query this class
- */
- public static function GetDatabase() {
- return QApplication::$Database[1];
- }
- /**
- * Load a Licencia from PK Info
- * @param integer $intIdLICENCIA
- * @param QQClause[] $objOptionalClauses additional optional QQClause objects for this query
- * @return Licencia
- */
- public static function Load($intIdLICENCIA, $objOptionalClauses = null) {
- // Use QuerySingle to Perform the Query
- return Licencia::QuerySingle(
- QQ::AndCondition(
- QQ::Equal(QQN::Licencia()->IdLICENCIA, $intIdLICENCIA)
- ),
- $objOptionalClauses
- );
- }
- /**
- * Load all Licencias
- * @param QQClause[] $objOptionalClauses additional optional QQClause objects for this query
- * @return Licencia[]
- */
- public static function LoadAll($objOptionalClauses = null) {
- if (func_num_args() > 1) {
- throw new QCallerException("LoadAll must be called with an array of optional clauses as a single argument");
- }
- // Call Licencia::QueryArray to perform the LoadAll query
- try {
- return Licencia::QueryArray(QQ::All(), $objOptionalClauses);
- } catch (QCallerException $objExc) {
- $objExc->IncrementOffset();
- throw $objExc;
- }
- }
- /**
- * Count all Licencias
- * @return int
- */
- public static function CountAll() {
- // Call Licencia::QueryCount to perform the CountAll query
- return Licencia::QueryCount(QQ::All());
- }
- ///////////////////////////////
- // QCUBED QUERY-RELATED METHODS
- ///////////////////////////////
- /**
- * Internally called method to assist with calling Qcubed Query for this class
- * on load methods.
- * @param QQueryBuilder &$objQueryBuilder the QueryBuilder object that will be created
- * @param QQCondition $objConditions any conditions on the query, itself
- * @param QQClause[] $objOptionalClausees additional optional QQClause object or array of QQClause objects for this query
- * @param mixed[] $mixParameterArray a array of name-value pairs to perform PrepareStatement with (sending in null will skip the PrepareStatement step)
- * @param boolean $blnCountOnly only select a rowcount
- * @return string the query statement
- */
- protected static function BuildQueryStatement(&$objQueryBuilder, QQCondition $objConditions, $objOptionalClauses, $mixParameterArray, $blnCountOnly) {
- // Get the Database Object for this Class
- $objDatabase = Licencia::GetDatabase();
- // Create/Build out the QueryBuilder object with Licencia-specific SELET and FROM fields
- $objQueryBuilder = new QQueryBuilder($objDatabase, 'LICENCIA');
- Licencia::GetSelectFields($objQueryBuilder);
- $objQueryBuilder->AddFromItem('LICENCIA');
- // Set "CountOnly" option (if applicable)
- if ($blnCountOnly)
- $objQueryBuilder->SetCountOnlyFlag();
- // Apply Any Conditions
- if ($objConditions)
- try {
- $objConditions->UpdateQueryBuilder($objQueryBuilder);
- } catch (QCallerException $objExc) {
- $objExc->IncrementOffset();
- throw $objExc;
- }
- // Iterate through all the Optional Clauses (if any) and perform accordingly
- if ($objOptionalClauses) {
- if ($objOptionalClauses instanceof QQClause)
- $objOptionalClauses->UpdateQueryBuilder($objQueryBuilder);
- else if (is_array($objOptionalClauses))
- foreach ($objOptionalClauses as $objClause)
- $objClause->UpdateQueryBuilder($objQueryBuilder);
- else
- throw new QCallerException('Optional Clauses must be a QQClause object or an array of QQClause objects');
- }
- // Get the SQL Statement
- $strQuery = $objQueryBuilder->GetStatement();
- // Prepare the Statement with the Query Parameters (if applicable)
- if ($mixParameterArray) {
- if (is_array($mixParameterArray)) {
- if (count($mixParameterArray))
- $strQuery = $objDatabase->PrepareStatement($strQuery, $mixParameterArray);
- // Ensure that there are no other Unresolved Named Parameters
- if (strpos($strQuery, chr(QQNamedValue::DelimiterCode) . '{') !== false)
- throw new QCallerException('Unresolved named parameters in the query');
- } else
- throw new QCallerException('Parameter Array must be an array of name-value parameter pairs');
- }
- // Return the Objects
- return $strQuery;
- }
- /**
- * Static Qcubed Query method to query for a single Licencia object.
- * Uses BuildQueryStatment to perform most of the work.
- * @param QQCondition $objConditions any conditions on the query, itself
- * @param QQClause[] $objOptionalClausees additional optional QQClause objects for this query
- * @param mixed[] $mixParameterArray a array of name-value pairs to perform PrepareStatement with
- * @return Licencia the queried object
- */
- public static function QuerySingle(QQCondition $objConditions, $objOptionalClauses = null, $mixParameterArray = null) {
- // Get the Query Statement
- try {
- $strQuery = Licencia::BuildQueryStatement($objQueryBuilder, $objConditions, $objOptionalClauses, $mixParameterArray, false);
- } catch (QCallerException $objExc) {
- $objExc->IncrementOffset();
- throw $objExc;
- }
-
- // Perform the Query, Get the First Row, and Instantiate a new Licencia object
- $objDbResult = $objQueryBuilder->Database->Query($strQuery);
-
- // Do we have to expand anything?
- if ($objQueryBuilder->ExpandAsArrayNodes) {
- $objToReturn = array();
- while ($objDbRow = $objDbResult->GetNextRow()) {
- $objItem = Licencia::InstantiateDbRow($objDbRow, null, $objQueryBuilder->ExpandAsArrayNodes, $objToReturn, $objQueryBuilder->ColumnAliasArray);
- if ($objItem)
- $objToReturn[] = $objItem;
- }
- if (count($objToReturn)) {
- // Since we only want the object to return, lets return the object and not the array.
- return $objToReturn[0];
- } else {
- return null;
- }
- } else {
- // No expands just return the first row
- $objDbRow = $objDbResult->GetNextRow();
- if(null === $objDbRow)
- return null;
- return Licencia::InstantiateDbRow($objDbRow, null, null, null, $objQueryBuilder->ColumnAliasArray);
- }
- }
- /**
- * Static Qcubed Query method to query for an array of Licencia objects.
- * Uses BuildQueryStatment to perform most of the work.
- * @param QQCondition $objConditions any conditions on the query, itself
- * @param QQClause[] $objOptionalClausees additional optional QQClause objects for this query
- * @param mixed[] $mixParameterArray a array of name-value pairs to perform PrepareStatement with
- * @return Licencia[] the queried objects as an array
- */
- public static function QueryArray(QQCondition $objConditions, $objOptionalClauses = null, $mixParameterArray = null) {
- // Get the Query Statement
- try {
- $strQuery = Licencia::BuildQueryStatement($objQueryBuilder, $objConditions, $objOptionalClauses, $mixParameterArray, false);
- } catch (QCallerException $objExc) {
- $objExc->IncrementOffset();
- throw $objExc;
- }
- // Perform the Query and Instantiate the Array Result
- $objDbResult = $objQueryBuilder->Database->Query($strQuery);
- return Licencia::InstantiateDbResult($objDbResult, $objQueryBuilder->ExpandAsArrayNodes, $objQueryBuilder->ColumnAliasArray);
- }
- /**
- * Static Qcubed Query method to query for a count of Licencia objects.
- * Uses BuildQueryStatment to perform most of the work.
- * @param QQCondition $objConditions any conditions on the query, itself
- * @param QQClause[] $objOptionalClausees additional optional QQClause objects for this query
- * @param mixed[] $mixParameterArray a array of name-value pairs to perform PrepareStatement with
- * @return integer the count of queried objects as an integer
- */
- public static function QueryCount(QQCondition $objConditions, $objOptionalClauses = null, $mixParameterArray = null) {
- // Get the Query Statement
- try {
- $strQuery = Licencia::BuildQueryStatement($objQueryBuilder, $objConditions, $objOptionalClauses, $mixParameterArray, true);
- } catch (QCallerException $objExc) {
- $objExc->IncrementOffset();
- throw $objExc;
- }
- // Perform the Query and return the row_count
- $objDbResult = $objQueryBuilder->Database->Query($strQuery);
- // Figure out if the query is using GroupBy
- $blnGrouped = false;
- if ($objOptionalClauses) foreach ($objOptionalClauses as $objClause) {
- if ($objClause instanceof QQGroupBy) {
- $blnGrouped = true;
- break;
- }
- }
- if ($blnGrouped)
- // Groups in this query - return the count of Groups (which is the count of all rows)
- return $objDbResult->CountRows();
- else {
- // No Groups - return the sql-calculated count(*) value
- $strDbRow = $objDbResult->FetchRow();
- return QType::Cast($strDbRow[0], QType::Integer);
- }
- }
- public static function QueryArrayCached(QQCondition $objConditions, $objOptionalClauses = null, $mixParameterArray = null, $blnForceUpdate = false) {
- // Get the Database Object for this Class
- $objDatabase = Licencia::GetDatabase();
- $strQuery = Licencia::BuildQueryStatement($objQueryBuilder, $objConditions, $objOptionalClauses, $mixParameterArray, false);
-
- $objCache = new QCache('qquery/licencia', $strQuery);
- $cacheData = $objCache->GetData();
-
- if (!$cacheData || $blnForceUpdate) {
- $objDbResult = $objQueryBuilder->Database->Query($strQuery);
- $arrResult = Licencia::InstantiateDbResult($objDbResult, $objQueryBuilder->ExpandAsArrayNodes, $objQueryBuilder->ColumnAliasArray);
- $objCache->SaveData(serialize($arrResult));
- } else {
- $arrResult = unserialize($cacheData);
- }
-
- return $arrResult;
- }
- /**
- * Updates a QQueryBuilder with the SELECT fields for this Licencia
- * @param QQueryBuilder $objBuilder the Query Builder object to update
- * @param string $strPrefix optional prefix to add to the SELECT fields
- */
- public static function GetSelectFields(QQueryBuilder $objBuilder, $strPrefix = null) {
- if ($strPrefix) {
- $strTableName = $strPrefix;
- $strAliasPrefix = $strPrefix . '__';
- } else {
- $strTableName = 'LICENCIA';
- $strAliasPrefix = '';
- }
- $objBuilder->AddSelectItem($strTableName, 'idLICENCIA', $strAliasPrefix . 'idLICENCIA');
- $objBuilder->AddSelectItem($strTableName, 'EMPRESA_idEMPRESA', $strAliasPrefix . 'EMPRESA_idEMPRESA');
- $objBuilder->AddSelectItem($strTableName, 'PROVEEDOR_idPROVEEDOR', $strAliasPrefix . 'PROVEEDOR_idPROVEEDOR');
- $objBuilder->AddSelectItem($strTableName, 'fechaInicio', $strAliasPrefix . 'fechaInicio');
- $objBuilder->AddSelectItem($strTableName, 'fechaFin', $strAliasPrefix . 'fechaFin');
- $objBuilder->AddSelectItem($strTableName, 'fechaFinEstimada', $strAliasPrefix . 'fechaFinEstimada');
- $objBuilder->AddSelectItem($strTableName, 'numeroProforma', $strAliasPrefix . 'numeroProforma');
- $objBuilder->AddSelectItem($strTableName, 'numeroCNP', $strAliasPrefix . 'numeroCNP');
- $objBuilder->AddSelectItem($strTableName, 'vencimientoCNP', $strAliasPrefix . 'vencimientoCNP');
- $objBuilder->AddSelectItem($strTableName, 'status', $strAliasPrefix . 'status');
- $objBuilder->AddSelectItem($strTableName, 'formaPago', $strAliasPrefix . 'formaPago');
- $objBuilder->AddSelectItem($strTableName, 'tipo', $strAliasPrefix . 'tipo');
- $objBuilder->AddSelectItem($strTableName, 'flete', $strAliasPrefix . 'flete');
- $objBuilder->AddSelectItem($strTableName, 'seguro', $strAliasPrefix . 'seguro');
- $objBuilder->AddSelectItem($strTableName, 'PROCESO_idPROCESO', $strAliasPrefix . 'PROCESO_idPROCESO');
- }
- ///////////////////////////////
- // INSTANTIATION-RELATED METHODS
- ///////////////////////////////
- /**
- * Instantiate a Licencia from a Database Row.
- * Takes in an optional strAliasPrefix, used in case another Object::InstantiateDbRow
- * is calling this Licencia::InstantiateDbRow in order to perform
- * early binding on referenced objects.
- * @param DatabaseRowBase $objDbRow
- * @param string $strAliasPrefix
- * @param string $strExpandAsArrayNodes
- * @param QBaseClass $arrPreviousItem
- * @param string[] $strColumnAliasArray
- * @return Licencia
- */
- public static function InstantiateDbRow($objDbRow, $strAliasPrefix = null, $strExpandAsArrayNodes = null, $arrPreviousItems = null, $strColumnAliasArray = array()) {
- // If blank row, return null
- if (!$objDbRow) {
- return null;
- }
- // See if we're doing an array expansion on the previous item
- $strAlias = $strAliasPrefix . 'idLICENCIA';
- $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
- if (($strExpandAsArrayNodes) && is_array($arrPreviousItems) && count($arrPreviousItems)) {
- foreach ($arrPreviousItems as $objPreviousItem) {
- if ($objPreviousItem->intIdLICENCIA == $objDbRow->GetColumn($strAliasName, 'Integer')) {
- // We are. Now, prepare to check for ExpandAsArray clauses
- $blnExpandedViaArray = false;
- if (!$strAliasPrefix)
- $strAliasPrefix = 'LICENCIA__';
- // Expanding reverse references: CodigoPagoAsLICENCIAIdLICENCIA
- $strAlias = $strAliasPrefix . 'codigopagoaslicenciaidlicencia__LICENCIA_idLICENCIA';
- $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
- if ((array_key_exists($strAlias, $strExpandAsArrayNodes)) &&
- (!is_null($objDbRow->GetColumn($strAliasName)))) {
- if ($intPreviousChildItemCount = count($objPreviousItem->_objCodigoPagoAsLICENCIAIdLICENCIAArray)) {
- $objPreviousChildItems = $objPreviousItem->_objCodigoPagoAsLICENCIAIdLICENCIAArray;
- $objChildItem = CodigoPago::InstantiateDbRow($objDbRow, $strAliasPrefix . 'codigopagoaslicenciaidlicencia__', $strExpandAsArrayNodes, $objPreviousChildItems, $strColumnAliasArray);
- if ($objChildItem) {
- $objPreviousItem->_objCodigoPagoAsLICENCIAIdLICENCIAArray[] = $objChildItem;
- }
- } else {
- $objPreviousItem->_objCodigoPagoAsLICENCIAIdLICENCIAArray[] = CodigoPago::InstantiateDbRow($objDbRow, $strAliasPrefix . 'codigopagoaslicenciaidlicencia__', $strExpandAsArrayNodes, null, $strColumnAliasArray);
- }
- $blnExpandedViaArray = true;
- }
- // Expanding reverse references: FaseLicenciaAsLICENCIAIdLICENCIA
- $strAlias = $strAliasPrefix . 'faselicenciaaslicenciaidlicencia__LICENCIA_idLICENCIA';
- $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
- if ((array_key_exists($strAlias, $strExpandAsArrayNodes)) &&
- (!is_null($objDbRow->GetColumn($strAliasName)))) {
- if ($intPreviousChildItemCount = count($objPreviousItem->_objFaseLicenciaAsLICENCIAIdLICENCIAArray)) {
- $objPreviousChildItems = $objPreviousItem->_objFaseLicenciaAsLICENCIAIdLICENCIAArray;
- $objChildItem = FaseLicencia::InstantiateDbRow($objDbRow, $strAliasPrefix . 'faselicenciaaslicenciaidlicencia__', $strExpandAsArrayNodes, $objPreviousChildItems, $strColumnAliasArray);
- if ($objChildItem) {
- $objPreviousItem->_objFaseLicenciaAsLICENCIAIdLICENCIAArray[] = $objChildItem;
- }
- } else {
- $objPreviousItem->_objFaseLicenciaAsLICENCIAIdLICENCIAArray[] = FaseLicencia::InstantiateDbRow($objDbRow, $strAliasPrefix . 'faselicenciaaslicenciaidlicencia__', $strExpandAsArrayNodes, null, $strColumnAliasArray);
- }
- $blnExpandedViaArray = true;
- }
- // Expanding reverse references: ImportacionAsLICENCIAIdLICENCIA
- $strAlias = $strAliasPrefix . 'importacionaslicenciaidlicencia__TRANSPORTE_idTRANSPORTE';
- $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
- if ((array_key_exists($strAlias, $strExpandAsArrayNodes)) &&
- (!is_null($objDbRow->GetColumn($strAliasName)))) {
- if ($intPreviousChildItemCount = count($objPreviousItem->_objImportacionAsLICENCIAIdLICENCIAArray)) {
- $objPreviousChildItems = $objPreviousItem->_objImportacionAsLICENCIAIdLICENCIAArray;
- $objChildItem = Importacion::InstantiateDbRow($objDbRow, $strAliasPrefix . 'importacionaslicenciaidlicencia__', $strExpandAsArrayNodes, $objPreviousChildItems, $strColumnAliasArray);
- if ($objChildItem) {
- $objPreviousItem->_objImportacionAsLICENCIAIdLICENCIAArray[] = $objChildItem;
- }
- } else {
- $objPreviousItem->_objImportacionAsLICENCIAIdLICENCIAArray[] = Importacion::InstantiateDbRow($objDbRow, $strAliasPrefix . 'importacionaslicenciaidlicencia__', $strExpandAsArrayNodes, null, $strColumnAliasArray);
- }
- $blnExpandedViaArray = true;
- }
- // Expanding reverse references: ListaProductoAsLICENCIAIdLICENCIA
- $strAlias = $strAliasPrefix . 'listaproductoaslicenciaidlicencia__LICENCIA_idLICENCIA';
- $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
- if ((array_key_exists($strAlias, $strExpandAsArrayNodes)) &&
- (!is_null($objDbRow->GetColumn($strAliasName)))) {
- if ($intPreviousChildItemCount = count($objPreviousItem->_objListaProductoAsLICENCIAIdLICENCIAArray)) {
- $objPreviousChildItems = $objPreviousItem->_objListaProductoAsLICENCIAIdLICENCIAArray;
- $objChildItem = ListaProducto::InstantiateDbRow($objDbRow, $strAliasPrefix . 'listaproductoaslicenciaidlicencia__', $strExpandAsArrayNodes, $objPreviousChildItems, $strColumnAliasArray);
- if ($objChildItem) {
- $objPreviousItem->_objListaProductoAsLICENCIAIdLICENCIAArray[] = $objChildItem;
- }
- } else {
- $objPreviousItem->_objListaProductoAsLICENCIAIdLICENCIAArray[] = ListaProducto::InstantiateDbRow($objDbRow, $strAliasPrefix . 'listaproductoaslicenciaidlicencia__', $strExpandAsArrayNodes, null, $strColumnAliasArray);
- }
- $blnExpandedViaArray = true;
- }
- // Expanding reverse references: ResponsableAsLICENCIAIdLICENCIA
- $strAlias = $strAliasPrefix . 'responsableaslicenciaidlicencia__EMPLEADO_idEMPLEADO';
- $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
- if ((array_key_exists($strAlias, $strExpandAsArrayNodes)) &&
- (!is_null($objDbRow->GetColumn($strAliasName)))) {
- if ($intPreviousChildItemCount = count($objPreviousItem->_objResponsableAsLICENCIAIdLICENCIAArray)) {
- $objPreviousChildItems = $objPreviousItem->_objResponsableAsLICENCIAIdLICENCIAArray;
- $objChildItem = Responsable::InstantiateDbRow($objDbRow, $strAliasPrefix . 'responsableaslicenciaidlicencia__', $strExpandAsArrayNodes, $objPreviousChildItems, $strColumnAliasArray);
- if ($objChildItem) {
- $objPreviousItem->_objResponsableAsLICENCIAIdLICENCIAArray[] = $objChildItem;
- }
- } else {
- $objPreviousItem->_objResponsableAsLICENCIAIdLICENCIAArray[] = Responsable::InstantiateDbRow($objDbRow, $strAliasPrefix . 'responsableaslicenciaidlicencia__', $strExpandAsArrayNodes, null, $strColumnAliasArray);
- }
- $blnExpandedViaArray = true;
- }
- // Expanding reverse references: VigenciaDocumentoAsLICENCIAIdLICENCIA
- $strAlias = $strAliasPrefix . 'vigenciadocumentoaslicenciaidlicencia__LICENCIA_idLICENCIA';
- $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
- if ((array_key_exists($strAlias, $strExpandAsArrayNodes)) &&
- (!is_null($objDbRow->GetColumn($strAliasName)))) {
- if ($intPreviousChildItemCount = count($objPreviousItem->_objVigenciaDocumentoAsLICENCIAIdLICENCIAArray)) {
- $objPreviousChildItems = $objPreviousItem->_objVigenciaDocumentoAsLICENCIAIdLICENCIAArray;
- $objChildItem = VigenciaDocumento::InstantiateDbRow($objDbRow, $strAliasPrefix . 'vigenciadocumentoaslicenciaidlicencia__', $strExpandAsArrayNodes, $objPreviousChildItems, $strColumnAliasArray);
- if ($objChildItem) {
- $objPreviousItem->_objVigenciaDocumentoAsLICENCIAIdLICENCIAArray[] = $objChildItem;
- }
- } else {
- $objPreviousItem->_objVigenciaDocumentoAsLICENCIAIdLICENCIAArray[] = VigenciaDocumento::InstantiateDbRow($objDbRow, $strAliasPrefix . 'vigenciadocumentoaslicenciaidlicencia__', $strExpandAsArrayNodes, null, $strColumnAliasArray);
- }
- $blnExpandedViaArray = true;
- }
- // Either return false to signal array expansion, or check-to-reset the Alias prefix and move on
- if ($blnExpandedViaArray) {
- return false;
- } else if ($strAliasPrefix == 'LICENCIA__') {
- $strAliasPrefix = null;
- }
- }
- }
- }
- // Create a new instance of the Licencia object
- $objToReturn = new Licencia();
- $objToReturn->__blnRestored = true;
- $strAliasName = array_key_exists($strAliasPrefix . 'idLICENCIA', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'idLICENCIA'] : $strAliasPrefix . 'idLICENCIA';
- $objToReturn->intIdLICENCIA = $objDbRow->GetColumn($strAliasName, 'Integer');
- $strAliasName = array_key_exists($strAliasPrefix . 'EMPRESA_idEMPRESA', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'EMPRESA_idEMPRESA'] : $strAliasPrefix . 'EMPRESA_idEMPRESA';
- $objToReturn->intEMPRESAIdEMPRESA = $objDbRow->GetColumn($strAliasName, 'Integer');
- $strAliasName = array_key_exists($strAliasPrefix . 'PROVEEDOR_idPROVEEDOR', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'PROVEEDOR_idPROVEEDOR'] : $strAliasPrefix . 'PROVEEDOR_idPROVEEDOR';
- $objToReturn->intPROVEEDORIdPROVEEDOR = $objDbRow->GetColumn($strAliasName, 'Integer');
- $strAliasName = array_key_exists($strAliasPrefix . 'fechaInicio', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'fechaInicio'] : $strAliasPrefix . 'fechaInicio';
- $objToReturn->dttFechaInicio = $objDbRow->GetColumn($strAliasName, 'Date');
- $strAliasName = array_key_exists($strAliasPrefix . 'fechaFin', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'fechaFin'] : $strAliasPrefix . 'fechaFin';
- $objToReturn->dttFechaFin = $objDbRow->GetColumn($strAliasName, 'Date');
- $strAliasName = array_key_exists($strAliasPrefix . 'fechaFinEstimada', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'fechaFinEstimada'] : $strAliasPrefix . 'fechaFinEstimada';
- $objToReturn->dttFechaFinEstimada = $objDbRow->GetColumn($strAliasName, 'Date');
- $strAliasName = array_key_exists($strAliasPrefix . 'numeroProforma', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'numeroProforma'] : $strAliasPrefix . 'numeroProforma';
- $objToReturn->strNumeroProforma = $objDbRow->GetColumn($strAliasName, 'VarChar');
- $strAliasName = array_key_exists($strAliasPrefix . 'numeroCNP', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'numeroCNP'] : $strAliasPrefix . 'numeroCNP';
- $objToReturn->strNumeroCNP = $objDbRow->GetColumn($strAliasName, 'VarChar');
- $strAliasName = array_key_exists($strAliasPrefix . 'vencimientoCNP', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'vencimientoCNP'] : $strAliasPrefix . 'vencimientoCNP';
- $objToReturn->dttVencimientoCNP = $objDbRow->GetColumn($strAliasName, 'Date');
- $strAliasName = array_key_exists($strAliasPrefix . 'status', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'status'] : $strAliasPrefix . 'status';
- $objToReturn->strStatus = $objDbRow->GetColumn($strAliasName, 'VarChar');
- $strAliasName = array_key_exists($strAliasPrefix . 'formaPago', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'formaPago'] : $strAliasPrefix . 'formaPago';
- $objToReturn->strFormaPago = $objDbRow->GetColumn($strAliasName, 'VarChar');
- $strAliasName = array_key_exists($strAliasPrefix . 'tipo', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'tipo'] : $strAliasPrefix . 'tipo';
- $objToReturn->strTipo = $objDbRow->GetColumn($strAliasName, 'VarChar');
- $strAliasName = array_key_exists($strAliasPrefix . 'flete', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'flete'] : $strAliasPrefix . 'flete';
- $objToReturn->fltFlete = $objDbRow->GetColumn($strAliasName, 'Float');
- $strAliasName = array_key_exists($strAliasPrefix . 'seguro', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'seguro'] : $strAliasPrefix . 'seguro';
- $objToReturn->strSeguro = $objDbRow->GetColumn($strAliasName, 'VarChar');
- $strAliasName = array_key_exists($strAliasPrefix . 'PROCESO_idPROCESO', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'PROCESO_idPROCESO'] : $strAliasPrefix . 'PROCESO_idPROCESO';
- $objToReturn->intPROCESOIdPROCESO = $objDbRow->GetColumn($strAliasName, 'Integer');
- if (isset($arrPreviousItems) && is_array($arrPreviousItems)) {
- foreach ($arrPreviousItems as $objPreviousItem) {
- if ($objToReturn->IdLICENCIA != $objPreviousItem->IdLICENCIA) {
- continue;
- }
- if (array_diff($objPreviousItem->_objCodigoPagoAsLICENCIAIdLICENCIAArray, $objToReturn->_objCodigoPagoAsLICENCIAIdLICENCIAArray) != null) {
- continue;
- }
- if (array_diff($objPreviousItem->_objFaseLicenciaAsLICENCIAIdLICENCIAArray, $objToReturn->_objFaseLicenciaAsLICENCIAIdLICENCIAArray) != null) {
- continue;
- }
- if (array_diff($objPreviousItem->_objImportacionAsLICENCIAIdLICENCIAArray, $objToReturn->_objImportacionAsLICENCIAIdLICENCIAArray) != null) {
- continue;
- }
- if (array_diff($objPreviousItem->_objListaProductoAsLICENCIAIdLICENCIAArray, $objToReturn->_objListaProductoAsLICENCIAIdLICENCIAArray) != null) {
- continue;
- }
- if (array_diff($objPreviousItem->_objResponsableAsLICENCIAIdLICENCIAArray, $objToReturn->_objResponsableAsLICENCIAIdLICENCIAArray) != null) {
- continue;
- }
- if (array_diff($objPreviousItem->_objVigenciaDocumentoAsLICENCIAIdLICENCIAArray, $objToReturn->_objVigenciaDocumentoAsLICENCIAIdLICENCIAArray) != null) {
- continue;
- }
- // complete match - all primary key columns are the same
- return null;
- }
- }
- // Instantiate Virtual Attributes
- foreach ($objDbRow->GetColumnNameArray() as $strColumnName => $mixValue) {
- $strVirtualPrefix = $strAliasPrefix . '__';
- $strVirtualPrefixLength = strlen($strVirtualPrefix);
- if (substr($strColumnName, 0, $strVirtualPrefixLength) == $strVirtualPrefix)
- $objToReturn->__strVirtualAttributeArray[substr($strColumnName, $strVirtualPrefixLength)] = $mixValue;
- }
- // Prepare to Check for Early/Virtual Binding
- if (!$strAliasPrefix)
- $strAliasPrefix = 'LICENCIA__';
- // Check for EMPRESAIdEMPRESAObject Early Binding
- $strAlias = $strAliasPrefix . 'EMPRESA_idEMPRESA__idEMPRESA';
- $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
- if (!is_null($objDbRow->GetColumn($strAliasName)))
- $objToReturn->objEMPRESAIdEMPRESAObject = Empresa::InstantiateDbRow($objDbRow, $strAliasPrefix . 'EMPRESA_idEMPRESA__', $strExpandAsArrayNodes, null, $strColumnAliasArray);
- // Check for PROVEEDORIdPROVEEDORObject Early Binding
- $strAlias = $strAliasPrefix . 'PROVEEDOR_idPROVEEDOR__idPROVEEDOR';
- $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
- if (!is_null($objDbRow->GetColumn($strAliasName)))
- $objToReturn->objPROVEEDORIdPROVEEDORObject = Proveedor::InstantiateDbRow($objDbRow, $strAliasPrefix . 'PROVEEDOR_idPROVEEDOR__', $strExpandAsArrayNodes, null, $strColumnAliasArray);
- // Check for PROCESOIdPROCESOObject Early Binding
- $strAlias = $strAliasPrefix . 'PROCESO_idPROCESO__idPROCESO';
- $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
- if (!is_null($objDbRow->GetColumn($strAliasName)))
- $objToReturn->objPROCESOIdPROCESOObject = Proceso::InstantiateDbRow($objDbRow, $strAliasPrefix . 'PROCESO_idPROCESO__', $strExpandAsArrayNodes, null, $strColumnAliasArray);
- // Check for CodigoPagoAsLICENCIAIdLICENCIA Virtual Binding
- $strAlias = $strAliasPrefix . 'codigopagoaslicenciaidlicencia__LICENCIA_idLICENCIA';
- $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
- if (!is_null($objDbRow->GetColumn($strAliasName))) {
- if (($strExpandAsArrayNodes) && (array_key_exists($strAlias, $strExpandAsArrayNodes)))
- $objToReturn->_objCodigoPagoAsLICENCIAIdLICENCIAArray[] = CodigoPago::InstantiateDbRow($objDbRow, $strAliasPrefix . 'codigopagoaslicenciaidlicencia__', $strExpandAsArrayNodes, null, $strColumnAliasArray);
- else
- $objToReturn->_objCodigoPagoAsLICENCIAIdLICENCIA = CodigoPago::InstantiateDbRow($objDbRow, $strAliasPrefix . 'codigopagoaslicenciaidlicencia__', $strExpandAsArrayNodes, null, $strColumnAliasArray);
- }
- // Check for FaseLicenciaAsLICENCIAIdLICENCIA Virtual Binding
- $strAlias = $strAliasPrefix . 'faselicenciaaslicenciaidlicencia__LICENCIA_idLICENCIA';
- $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
- if (!is_null($objDbRow->GetColumn($strAliasName))) {
- if (($strExpandAsArrayNodes) && (array_key_exists($strAlias, $strExpandAsArrayNodes)))
- $objToReturn->_objFaseLicenciaAsLICENCIAIdLICENCIAArray[] = FaseLicencia::InstantiateDbRow($objDbRow, $strAliasPrefix . 'faselicenciaaslicenciaidlicencia__', $strExpandAsArrayNodes, null, $strColumnAliasArray);
- else
- $objToReturn->_objFaseLicenciaAsLICENCIAIdLICENCIA = FaseLicencia::InstantiateDbRow($objDbRow, $strAliasPrefix . 'faselicenciaaslicenciaidlicencia__', $strExpandAsArrayNodes, null, $strColumnAliasArray);
- }
- // Check for ImportacionAsLICENCIAIdLICENCIA Virtual Binding
- $strAlias = $strAliasPrefix . 'importacionaslicenciaidlicencia__TRANSPORTE_idTRANSPORTE';
- $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
- if (!is_null($objDbRow->GetColumn($strAliasName))) {
- if (($strExpandAsArrayNodes) && (array_key_exists($strAlias, $strExpandAsArrayNodes)))
- $objToReturn->_objImportacionAsLICENCIAIdLICENCIAArray[] = Importacion::InstantiateDbRow($objDbRow, $strAliasPrefix . 'importacionaslicenciaidlicencia__', $strExpandAsArrayNodes, null, $strColumnAliasArray);
- else
- $objToReturn->_objImportacionAsLICENCIAIdLICENCIA = Importacion::InstantiateDbRow($objDbRow, $strAliasPrefix . 'importacionaslicenciaidlicencia__', $strExpandAsArrayNodes, null, $strColumnAliasArray);
- }
- // Check for ListaProductoAsLICENCIAIdLICENCIA Virtual Binding
- $strAlias = $strAliasPrefix . 'listaproductoaslicenciaidlicencia__LICENCIA_idLICENCIA';
- $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
- if (!is_null($objDbRow->GetColumn($strAliasName))) {
- if (($strExpandAsArrayNodes) && (array_key_exists($strAlias, $strExpandAsArrayNodes)))
- $objToReturn->_objListaProductoAsLICENCIAIdLICENCIAArray[] = ListaProducto::InstantiateDbRow($objDbRow, $strAliasPrefix . 'listaproductoaslicenciaidlicencia__', $strExpandAsArrayNodes, null, $strColumnAliasArray);
- else
- $objToReturn->_objListaProductoAsLICENCIAIdLICENCIA = ListaProducto::InstantiateDbRow($objDbRow, $strAliasPrefix . 'listaproductoaslicenciaidlicencia__', $strExpandAsArrayNodes, null, $strColumnAliasArray);
- }
- // Check for ResponsableAsLICENCIAIdLICENCIA Virtual Binding
- $strAlias = $strAliasPrefix . 'responsableaslicenciaidlicencia__EMPLEADO_idEMPLEADO';
- $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
- if (!is_null($objDbRow->GetColumn($strAliasName))) {
- if (($strExpandAsArrayNodes) && (array_key_exists($strAlias, $strExpandAsArrayNodes)))
- $objToReturn->_objResponsableAsLICENCIAIdLICENCIAArray[] = Responsable::InstantiateDbRow($objDbRow, $strAliasPrefix . 'responsableaslicenciaidlicencia__', $strExpandAsArrayNodes, null, $strColumnAliasArray);
- else
- $objToReturn->_objResponsableAsLICENCIAIdLICENCIA = Responsable::InstantiateDbRow($objDbRow, $strAliasPrefix . 'responsableaslicenciaidlicencia__', $strExpandAsArrayNodes, null, $strColumnAliasArray);
- }
- // Check for VigenciaDocumentoAsLICENCIAIdLICENCIA Virtual Binding
- $strAlias = $strAliasPrefix . 'vigenciadocumentoaslicenciaidlicencia__LICENCIA_idLICENCIA';
- $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
- if (!is_null($objDbRow->GetColumn($strAliasName))) {
- if (($strExpandAsArrayNodes) && (array_key_exists($strAlias, $strExpandAsArrayNodes)))
- $objToReturn->_objVigenciaDocumentoAsLICENCIAIdLICENCIAArray[] = VigenciaDocumento::InstantiateDbRow($objDbRow, $strAliasPrefix . 'vigenciadocumentoaslicenciaidlicencia__', $strExpandAsArrayNodes, null, $strColumnAliasArray);
- else
- $objToReturn->_objVigenciaDocumentoAsLICENCIAIdLICENCIA = VigenciaDocumento::InstantiateDbRow($objDbRow, $strAliasPrefix . 'vigenciadocumentoaslicenciaidlicencia__', $strExpandAsArrayNodes, null, $strColumnAliasArray);
- }
- return $objToReturn;
- }
- /**
- * Instantiate an array of Licencias from a Database Result
- * @param DatabaseResultBase $objDbResult
- * @param string $strExpandAsArrayNodes
- * @param string[] $strColumnAliasArray
- * @return Licencia[]
- */
- public static function Insta…
Large files files are truncated, but you can click here to view the full file