当前位置: 首页>>代码示例>>PHP>>正文


PHP Variable::InstantiateDbRow方法代码示例

本文整理汇总了PHP中Variable::InstantiateDbRow方法的典型用法代码示例。如果您正苦于以下问题:PHP Variable::InstantiateDbRow方法的具体用法?PHP Variable::InstantiateDbRow怎么用?PHP Variable::InstantiateDbRow使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Variable的用法示例。


在下文中一共展示了Variable::InstantiateDbRow方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: InstantiateDbRow

 /**
  * Instantiate a ClassVariable from a Database Row.
  * Takes in an optional strAliasPrefix, used in case another Object::InstantiateDbRow
  * is calling this ClassVariable::InstantiateDbRow in order to perform
  * early binding on referenced objects.
  * @param DatabaseRowBase $objDbRow
  * @param string $strAliasPrefix
  * @return ClassVariable
  */
 public static function InstantiateDbRow($objDbRow, $strAliasPrefix = null, $strExpandAsArrayNodes = null, $objPreviousItem = null)
 {
     // If blank row, return null
     if (!$objDbRow) {
         return null;
     }
     // See if we're doing an array expansion on the previous item
     if ($strExpandAsArrayNodes && $objPreviousItem && $objPreviousItem->intId == $objDbRow->GetColumn($strAliasPrefix . 'id', 'Integer')) {
         // We are.  Now, prepare to check for ExpandAsArray clauses
         $blnExpandedViaArray = false;
         if (!$strAliasPrefix) {
             $strAliasPrefix = 'class_variable__';
         }
         if (array_key_exists($strAliasPrefix . 'classproperty__id', $strExpandAsArrayNodes) && !is_null($objDbRow->GetColumn($strAliasPrefix . 'classproperty__id'))) {
             if ($intPreviousChildItemCount = count($objPreviousItem->_objClassPropertyArray)) {
                 $objPreviousChildItem = $objPreviousItem->_objClassPropertyArray[$intPreviousChildItemCount - 1];
                 $objChildItem = ClassProperty::InstantiateDbRow($objDbRow, $strAliasPrefix . 'classproperty__', $strExpandAsArrayNodes, $objPreviousChildItem);
                 if ($objChildItem) {
                     array_push($objPreviousItem->_objClassPropertyArray, $objChildItem);
                 }
             } else {
                 array_push($objPreviousItem->_objClassPropertyArray, ClassProperty::InstantiateDbRow($objDbRow, $strAliasPrefix . 'classproperty__', $strExpandAsArrayNodes));
             }
             $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 == 'class_variable__') {
                 $strAliasPrefix = null;
             }
         }
     }
     // Create a new instance of the ClassVariable object
     $objToReturn = new ClassVariable();
     $objToReturn->__blnRestored = true;
     $objToReturn->intId = $objDbRow->GetColumn($strAliasPrefix . 'id', 'Integer');
     $objToReturn->intQcodoClassId = $objDbRow->GetColumn($strAliasPrefix . 'qcodo_class_id', 'Integer');
     $objToReturn->intVariableGroupId = $objDbRow->GetColumn($strAliasPrefix . 'variable_group_id', 'Integer');
     $objToReturn->intProtectionTypeId = $objDbRow->GetColumn($strAliasPrefix . 'protection_type_id', 'Integer');
     $objToReturn->intVariableId = $objDbRow->GetColumn($strAliasPrefix . 'variable_id', 'Integer');
     $objToReturn->blnReadOnlyFlag = $objDbRow->GetColumn($strAliasPrefix . 'read_only_flag', 'Bit');
     $objToReturn->blnStaticFlag = $objDbRow->GetColumn($strAliasPrefix . 'static_flag', 'Bit');
     // 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 = 'class_variable__';
     }
     // Check for QcodoClass Early Binding
     if (!is_null($objDbRow->GetColumn($strAliasPrefix . 'qcodo_class_id__id'))) {
         $objToReturn->objQcodoClass = QcodoClass::InstantiateDbRow($objDbRow, $strAliasPrefix . 'qcodo_class_id__', $strExpandAsArrayNodes);
     }
     // Check for VariableGroup Early Binding
     if (!is_null($objDbRow->GetColumn($strAliasPrefix . 'variable_group_id__id'))) {
         $objToReturn->objVariableGroup = VariableGroup::InstantiateDbRow($objDbRow, $strAliasPrefix . 'variable_group_id__', $strExpandAsArrayNodes);
     }
     // Check for Variable Early Binding
     if (!is_null($objDbRow->GetColumn($strAliasPrefix . 'variable_id__id'))) {
         $objToReturn->objVariable = Variable::InstantiateDbRow($objDbRow, $strAliasPrefix . 'variable_id__', $strExpandAsArrayNodes);
     }
     // Check for ClassProperty Virtual Binding
     if (!is_null($objDbRow->GetColumn($strAliasPrefix . 'classproperty__id'))) {
         if ($strExpandAsArrayNodes && array_key_exists($strAliasPrefix . 'classproperty__id', $strExpandAsArrayNodes)) {
             array_push($objToReturn->_objClassPropertyArray, ClassProperty::InstantiateDbRow($objDbRow, $strAliasPrefix . 'classproperty__', $strExpandAsArrayNodes));
         } else {
             $objToReturn->_objClassProperty = ClassProperty::InstantiateDbRow($objDbRow, $strAliasPrefix . 'classproperty__', $strExpandAsArrayNodes);
         }
     }
     return $objToReturn;
 }
开发者ID:qcodo,项目名称:qcodo-api,代码行数:87,代码来源:ClassVariableGen.class.php

示例2: InstantiateDbRow

 /**
  * Instantiate a Parameter from a Database Row.
  * Takes in an optional strAliasPrefix, used in case another Object::InstantiateDbRow
  * is calling this Parameter::InstantiateDbRow in order to perform
  * early binding on referenced objects.
  * @param DatabaseRowBase $objDbRow
  * @param string $strAliasPrefix
  * @return Parameter
  */
 public static function InstantiateDbRow($objDbRow, $strAliasPrefix = null, $strExpandAsArrayNodes = null, $objPreviousItem = null)
 {
     // If blank row, return null
     if (!$objDbRow) {
         return null;
     }
     // Create a new instance of the Parameter object
     $objToReturn = new Parameter();
     $objToReturn->__blnRestored = true;
     $objToReturn->intId = $objDbRow->GetColumn($strAliasPrefix . 'id', 'Integer');
     $objToReturn->intOperationId = $objDbRow->GetColumn($strAliasPrefix . 'operation_id', 'Integer');
     $objToReturn->intOrderNumber = $objDbRow->GetColumn($strAliasPrefix . 'order_number', 'Integer');
     $objToReturn->intVariableId = $objDbRow->GetColumn($strAliasPrefix . 'variable_id', 'Integer');
     $objToReturn->blnReferenceFlag = $objDbRow->GetColumn($strAliasPrefix . 'reference_flag', 'Bit');
     // 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 = 'parameter__';
     }
     // Check for Operation Early Binding
     if (!is_null($objDbRow->GetColumn($strAliasPrefix . 'operation_id__id'))) {
         $objToReturn->objOperation = Operation::InstantiateDbRow($objDbRow, $strAliasPrefix . 'operation_id__', $strExpandAsArrayNodes);
     }
     // Check for Variable Early Binding
     if (!is_null($objDbRow->GetColumn($strAliasPrefix . 'variable_id__id'))) {
         $objToReturn->objVariable = Variable::InstantiateDbRow($objDbRow, $strAliasPrefix . 'variable_id__', $strExpandAsArrayNodes);
     }
     return $objToReturn;
 }
开发者ID:qcodo,项目名称:qcodo-api,代码行数:45,代码来源:ParameterGen.class.php

示例3: InstantiateDbResult

 /**
  * Instantiate an array of Variables from a Database Result
  * @param DatabaseResultBase $objDbResult
  * @return Variable[]
  */
 public static function InstantiateDbResult(QDatabaseResultBase $objDbResult, $strExpandAsArrayNodes = null)
 {
     $objToReturn = array();
     // If blank resultset, then return empty array
     if (!$objDbResult) {
         return $objToReturn;
     }
     // Load up the return array with each row
     if ($strExpandAsArrayNodes) {
         $objLastRowItem = null;
         while ($objDbRow = $objDbResult->GetNextRow()) {
             $objItem = Variable::InstantiateDbRow($objDbRow, null, $strExpandAsArrayNodes, $objLastRowItem);
             if ($objItem) {
                 array_push($objToReturn, $objItem);
                 $objLastRowItem = $objItem;
             }
         }
     } else {
         while ($objDbRow = $objDbResult->GetNextRow()) {
             array_push($objToReturn, Variable::InstantiateDbRow($objDbRow));
         }
     }
     return $objToReturn;
 }
开发者ID:qcodo,项目名称:qcodo-api,代码行数:29,代码来源:VariableGen.class.php

示例4: InstantiateDbRow

 /**
  * Instantiate a Operation from a Database Row.
  * Takes in an optional strAliasPrefix, used in case another Object::InstantiateDbRow
  * is calling this Operation::InstantiateDbRow in order to perform
  * early binding on referenced objects.
  * @param DatabaseRowBase $objDbRow
  * @param string $strAliasPrefix
  * @return Operation
  */
 public static function InstantiateDbRow($objDbRow, $strAliasPrefix = null, $strExpandAsArrayNodes = null, $objPreviousItem = null)
 {
     // If blank row, return null
     if (!$objDbRow) {
         return null;
     }
     // See if we're doing an array expansion on the previous item
     if ($strExpandAsArrayNodes && $objPreviousItem && $objPreviousItem->intId == $objDbRow->GetColumn($strAliasPrefix . 'id', 'Integer')) {
         // We are.  Now, prepare to check for ExpandAsArray clauses
         $blnExpandedViaArray = false;
         if (!$strAliasPrefix) {
             $strAliasPrefix = 'operation__';
         }
         if (array_key_exists($strAliasPrefix . 'parameter__id', $strExpandAsArrayNodes) && !is_null($objDbRow->GetColumn($strAliasPrefix . 'parameter__id'))) {
             if ($intPreviousChildItemCount = count($objPreviousItem->_objParameterArray)) {
                 $objPreviousChildItem = $objPreviousItem->_objParameterArray[$intPreviousChildItemCount - 1];
                 $objChildItem = Parameter::InstantiateDbRow($objDbRow, $strAliasPrefix . 'parameter__', $strExpandAsArrayNodes, $objPreviousChildItem);
                 if ($objChildItem) {
                     array_push($objPreviousItem->_objParameterArray, $objChildItem);
                 }
             } else {
                 array_push($objPreviousItem->_objParameterArray, Parameter::InstantiateDbRow($objDbRow, $strAliasPrefix . 'parameter__', $strExpandAsArrayNodes));
             }
             $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 == 'operation__') {
                 $strAliasPrefix = null;
             }
         }
     }
     // Create a new instance of the Operation object
     $objToReturn = new Operation();
     $objToReturn->__blnRestored = true;
     $objToReturn->intId = $objDbRow->GetColumn($strAliasPrefix . 'id', 'Integer');
     $objToReturn->intQcodoClassId = $objDbRow->GetColumn($strAliasPrefix . 'qcodo_class_id', 'Integer');
     $objToReturn->intQcodoInterfaceId = $objDbRow->GetColumn($strAliasPrefix . 'qcodo_interface_id', 'Integer');
     $objToReturn->strName = $objDbRow->GetColumn($strAliasPrefix . 'name', 'VarChar');
     $objToReturn->intProtectionTypeId = $objDbRow->GetColumn($strAliasPrefix . 'protection_type_id', 'Integer');
     $objToReturn->blnStaticFlag = $objDbRow->GetColumn($strAliasPrefix . 'static_flag', 'Bit');
     $objToReturn->blnAbstractFlag = $objDbRow->GetColumn($strAliasPrefix . 'abstract_flag', 'Bit');
     $objToReturn->blnFinalFlag = $objDbRow->GetColumn($strAliasPrefix . 'final_flag', 'Bit');
     $objToReturn->intReturnVariableId = $objDbRow->GetColumn($strAliasPrefix . 'return_variable_id', 'Integer');
     $objToReturn->intAdditionalVariableId = $objDbRow->GetColumn($strAliasPrefix . 'additional_variable_id', 'Integer');
     $objToReturn->strFirstVersion = $objDbRow->GetColumn($strAliasPrefix . 'first_version', 'VarChar');
     $objToReturn->strLastVersion = $objDbRow->GetColumn($strAliasPrefix . 'last_version', 'VarChar');
     $objToReturn->strShortDescription = $objDbRow->GetColumn($strAliasPrefix . 'short_description', 'Blob');
     $objToReturn->strExtendedDescription = $objDbRow->GetColumn($strAliasPrefix . 'extended_description', 'Blob');
     $objToReturn->intFileId = $objDbRow->GetColumn($strAliasPrefix . 'file_id', 'Integer');
     // 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 = 'operation__';
     }
     // Check for QcodoClass Early Binding
     if (!is_null($objDbRow->GetColumn($strAliasPrefix . 'qcodo_class_id__id'))) {
         $objToReturn->objQcodoClass = QcodoClass::InstantiateDbRow($objDbRow, $strAliasPrefix . 'qcodo_class_id__', $strExpandAsArrayNodes);
     }
     // Check for QcodoInterface Early Binding
     if (!is_null($objDbRow->GetColumn($strAliasPrefix . 'qcodo_interface_id__id'))) {
         $objToReturn->objQcodoInterface = QcodoInterface::InstantiateDbRow($objDbRow, $strAliasPrefix . 'qcodo_interface_id__', $strExpandAsArrayNodes);
     }
     // Check for ReturnVariable Early Binding
     if (!is_null($objDbRow->GetColumn($strAliasPrefix . 'return_variable_id__id'))) {
         $objToReturn->objReturnVariable = Variable::InstantiateDbRow($objDbRow, $strAliasPrefix . 'return_variable_id__', $strExpandAsArrayNodes);
     }
     // Check for AdditionalVariable Early Binding
     if (!is_null($objDbRow->GetColumn($strAliasPrefix . 'additional_variable_id__id'))) {
         $objToReturn->objAdditionalVariable = Variable::InstantiateDbRow($objDbRow, $strAliasPrefix . 'additional_variable_id__', $strExpandAsArrayNodes);
     }
     // Check for File Early Binding
     if (!is_null($objDbRow->GetColumn($strAliasPrefix . 'file_id__id'))) {
         $objToReturn->objFile = File::InstantiateDbRow($objDbRow, $strAliasPrefix . 'file_id__', $strExpandAsArrayNodes);
     }
     // Check for Parameter Virtual Binding
     if (!is_null($objDbRow->GetColumn($strAliasPrefix . 'parameter__id'))) {
         if ($strExpandAsArrayNodes && array_key_exists($strAliasPrefix . 'parameter__id', $strExpandAsArrayNodes)) {
             array_push($objToReturn->_objParameterArray, Parameter::InstantiateDbRow($objDbRow, $strAliasPrefix . 'parameter__', $strExpandAsArrayNodes));
         } else {
             $objToReturn->_objParameter = Parameter::InstantiateDbRow($objDbRow, $strAliasPrefix . 'parameter__', $strExpandAsArrayNodes);
         }
//.........这里部分代码省略.........
开发者ID:qcodo,项目名称:qcodo-api,代码行数:101,代码来源:OperationGen.class.php

示例5: InstantiateDbRow

 /**
  * Instantiate a ClassProperty from a Database Row.
  * Takes in an optional strAliasPrefix, used in case another Object::InstantiateDbRow
  * is calling this ClassProperty::InstantiateDbRow in order to perform
  * early binding on referenced objects.
  * @param DatabaseRowBase $objDbRow
  * @param string $strAliasPrefix
  * @return ClassProperty
  */
 public static function InstantiateDbRow($objDbRow, $strAliasPrefix = null, $strExpandAsArrayNodes = null, $objPreviousItem = null)
 {
     // If blank row, return null
     if (!$objDbRow) {
         return null;
     }
     // Create a new instance of the ClassProperty object
     $objToReturn = new ClassProperty();
     $objToReturn->__blnRestored = true;
     $objToReturn->intId = $objDbRow->GetColumn($strAliasPrefix . 'id', 'Integer');
     $objToReturn->intQcodoClassId = $objDbRow->GetColumn($strAliasPrefix . 'qcodo_class_id', 'Integer');
     $objToReturn->intVariableGroupId = $objDbRow->GetColumn($strAliasPrefix . 'variable_group_id', 'Integer');
     $objToReturn->intVariableId = $objDbRow->GetColumn($strAliasPrefix . 'variable_id', 'Integer');
     $objToReturn->intClassVariableId = $objDbRow->GetColumn($strAliasPrefix . 'class_variable_id', 'Integer');
     $objToReturn->blnReadOnlyFlag = $objDbRow->GetColumn($strAliasPrefix . 'read_only_flag', 'Bit');
     $objToReturn->blnWriteOnlyFlag = $objDbRow->GetColumn($strAliasPrefix . 'write_only_flag', 'Bit');
     // 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 = 'class_property__';
     }
     // Check for QcodoClass Early Binding
     if (!is_null($objDbRow->GetColumn($strAliasPrefix . 'qcodo_class_id__id'))) {
         $objToReturn->objQcodoClass = QcodoClass::InstantiateDbRow($objDbRow, $strAliasPrefix . 'qcodo_class_id__', $strExpandAsArrayNodes);
     }
     // Check for VariableGroup Early Binding
     if (!is_null($objDbRow->GetColumn($strAliasPrefix . 'variable_group_id__id'))) {
         $objToReturn->objVariableGroup = VariableGroup::InstantiateDbRow($objDbRow, $strAliasPrefix . 'variable_group_id__', $strExpandAsArrayNodes);
     }
     // Check for Variable Early Binding
     if (!is_null($objDbRow->GetColumn($strAliasPrefix . 'variable_id__id'))) {
         $objToReturn->objVariable = Variable::InstantiateDbRow($objDbRow, $strAliasPrefix . 'variable_id__', $strExpandAsArrayNodes);
     }
     // Check for ClassVariable Early Binding
     if (!is_null($objDbRow->GetColumn($strAliasPrefix . 'class_variable_id__id'))) {
         $objToReturn->objClassVariable = ClassVariable::InstantiateDbRow($objDbRow, $strAliasPrefix . 'class_variable_id__', $strExpandAsArrayNodes);
     }
     return $objToReturn;
 }
开发者ID:qcodo,项目名称:qcodo-api,代码行数:55,代码来源:ClassPropertyGen.class.php

示例6: InstantiateDbRow

 /**
  * Instantiate a QcodoConstant from a Database Row.
  * Takes in an optional strAliasPrefix, used in case another Object::InstantiateDbRow
  * is calling this QcodoConstant::InstantiateDbRow in order to perform
  * early binding on referenced objects.
  * @param DatabaseRowBase $objDbRow
  * @param string $strAliasPrefix
  * @return QcodoConstant
  */
 public static function InstantiateDbRow($objDbRow, $strAliasPrefix = null, $strExpandAsArrayNodes = null, $objPreviousItem = null)
 {
     // If blank row, return null
     if (!$objDbRow) {
         return null;
     }
     // Create a new instance of the QcodoConstant object
     $objToReturn = new QcodoConstant();
     $objToReturn->__blnRestored = true;
     $objToReturn->intId = $objDbRow->GetColumn($strAliasPrefix . 'id', 'Integer');
     $objToReturn->intQcodoClassId = $objDbRow->GetColumn($strAliasPrefix . 'qcodo_class_id', 'Integer');
     $objToReturn->intVariableId = $objDbRow->GetColumn($strAliasPrefix . 'variable_id', 'Integer');
     $objToReturn->intFileId = $objDbRow->GetColumn($strAliasPrefix . 'file_id', 'Integer');
     // 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 = 'qcodo_constant__';
     }
     // Check for QcodoClass Early Binding
     if (!is_null($objDbRow->GetColumn($strAliasPrefix . 'qcodo_class_id__id'))) {
         $objToReturn->objQcodoClass = QcodoClass::InstantiateDbRow($objDbRow, $strAliasPrefix . 'qcodo_class_id__', $strExpandAsArrayNodes);
     }
     // Check for Variable Early Binding
     if (!is_null($objDbRow->GetColumn($strAliasPrefix . 'variable_id__id'))) {
         $objToReturn->objVariable = Variable::InstantiateDbRow($objDbRow, $strAliasPrefix . 'variable_id__', $strExpandAsArrayNodes);
     }
     // Check for File Early Binding
     if (!is_null($objDbRow->GetColumn($strAliasPrefix . 'file_id__id'))) {
         $objToReturn->objFile = File::InstantiateDbRow($objDbRow, $strAliasPrefix . 'file_id__', $strExpandAsArrayNodes);
     }
     return $objToReturn;
 }
开发者ID:qcodo,项目名称:qcodo-api,代码行数:48,代码来源:QcodoConstantGen.class.php

示例7: InstantiateDbRow

 /**
  * Instantiate a QcodoClass from a Database Row.
  * Takes in an optional strAliasPrefix, used in case another Object::InstantiateDbRow
  * is calling this QcodoClass::InstantiateDbRow in order to perform
  * early binding on referenced objects.
  * @param DatabaseRowBase $objDbRow
  * @param string $strAliasPrefix
  * @return QcodoClass
  */
 public static function InstantiateDbRow($objDbRow, $strAliasPrefix = null, $strExpandAsArrayNodes = null, $objPreviousItem = null)
 {
     // If blank row, return null
     if (!$objDbRow) {
         return null;
     }
     // See if we're doing an array expansion on the previous item
     if ($strExpandAsArrayNodes && $objPreviousItem && $objPreviousItem->intId == $objDbRow->GetColumn($strAliasPrefix . 'id', 'Integer')) {
         // We are.  Now, prepare to check for ExpandAsArray clauses
         $blnExpandedViaArray = false;
         if (!$strAliasPrefix) {
             $strAliasPrefix = 'qcodo_class__';
         }
         if (array_key_exists($strAliasPrefix . 'classproperty__id', $strExpandAsArrayNodes) && !is_null($objDbRow->GetColumn($strAliasPrefix . 'classproperty__id'))) {
             if ($intPreviousChildItemCount = count($objPreviousItem->_objClassPropertyArray)) {
                 $objPreviousChildItem = $objPreviousItem->_objClassPropertyArray[$intPreviousChildItemCount - 1];
                 $objChildItem = ClassProperty::InstantiateDbRow($objDbRow, $strAliasPrefix . 'classproperty__', $strExpandAsArrayNodes, $objPreviousChildItem);
                 if ($objChildItem) {
                     array_push($objPreviousItem->_objClassPropertyArray, $objChildItem);
                 }
             } else {
                 array_push($objPreviousItem->_objClassPropertyArray, ClassProperty::InstantiateDbRow($objDbRow, $strAliasPrefix . 'classproperty__', $strExpandAsArrayNodes));
             }
             $blnExpandedViaArray = true;
         }
         if (array_key_exists($strAliasPrefix . 'classvariable__id', $strExpandAsArrayNodes) && !is_null($objDbRow->GetColumn($strAliasPrefix . 'classvariable__id'))) {
             if ($intPreviousChildItemCount = count($objPreviousItem->_objClassVariableArray)) {
                 $objPreviousChildItem = $objPreviousItem->_objClassVariableArray[$intPreviousChildItemCount - 1];
                 $objChildItem = ClassVariable::InstantiateDbRow($objDbRow, $strAliasPrefix . 'classvariable__', $strExpandAsArrayNodes, $objPreviousChildItem);
                 if ($objChildItem) {
                     array_push($objPreviousItem->_objClassVariableArray, $objChildItem);
                 }
             } else {
                 array_push($objPreviousItem->_objClassVariableArray, ClassVariable::InstantiateDbRow($objDbRow, $strAliasPrefix . 'classvariable__', $strExpandAsArrayNodes));
             }
             $blnExpandedViaArray = true;
         }
         if (array_key_exists($strAliasPrefix . 'operation__id', $strExpandAsArrayNodes) && !is_null($objDbRow->GetColumn($strAliasPrefix . 'operation__id'))) {
             if ($intPreviousChildItemCount = count($objPreviousItem->_objOperationArray)) {
                 $objPreviousChildItem = $objPreviousItem->_objOperationArray[$intPreviousChildItemCount - 1];
                 $objChildItem = Operation::InstantiateDbRow($objDbRow, $strAliasPrefix . 'operation__', $strExpandAsArrayNodes, $objPreviousChildItem);
                 if ($objChildItem) {
                     array_push($objPreviousItem->_objOperationArray, $objChildItem);
                 }
             } else {
                 array_push($objPreviousItem->_objOperationArray, Operation::InstantiateDbRow($objDbRow, $strAliasPrefix . 'operation__', $strExpandAsArrayNodes));
             }
             $blnExpandedViaArray = true;
         }
         if (array_key_exists($strAliasPrefix . 'childqcodoclass__id', $strExpandAsArrayNodes) && !is_null($objDbRow->GetColumn($strAliasPrefix . 'childqcodoclass__id'))) {
             if ($intPreviousChildItemCount = count($objPreviousItem->_objChildQcodoClassArray)) {
                 $objPreviousChildItem = $objPreviousItem->_objChildQcodoClassArray[$intPreviousChildItemCount - 1];
                 $objChildItem = QcodoClass::InstantiateDbRow($objDbRow, $strAliasPrefix . 'childqcodoclass__', $strExpandAsArrayNodes, $objPreviousChildItem);
                 if ($objChildItem) {
                     array_push($objPreviousItem->_objChildQcodoClassArray, $objChildItem);
                 }
             } else {
                 array_push($objPreviousItem->_objChildQcodoClassArray, QcodoClass::InstantiateDbRow($objDbRow, $strAliasPrefix . 'childqcodoclass__', $strExpandAsArrayNodes));
             }
             $blnExpandedViaArray = true;
         }
         if (array_key_exists($strAliasPrefix . 'qcodoconstant__id', $strExpandAsArrayNodes) && !is_null($objDbRow->GetColumn($strAliasPrefix . 'qcodoconstant__id'))) {
             if ($intPreviousChildItemCount = count($objPreviousItem->_objQcodoConstantArray)) {
                 $objPreviousChildItem = $objPreviousItem->_objQcodoConstantArray[$intPreviousChildItemCount - 1];
                 $objChildItem = QcodoConstant::InstantiateDbRow($objDbRow, $strAliasPrefix . 'qcodoconstant__', $strExpandAsArrayNodes, $objPreviousChildItem);
                 if ($objChildItem) {
                     array_push($objPreviousItem->_objQcodoConstantArray, $objChildItem);
                 }
             } else {
                 array_push($objPreviousItem->_objQcodoConstantArray, QcodoConstant::InstantiateDbRow($objDbRow, $strAliasPrefix . 'qcodoconstant__', $strExpandAsArrayNodes));
             }
             $blnExpandedViaArray = true;
         }
         if (array_key_exists($strAliasPrefix . 'variableasobjecttype__id', $strExpandAsArrayNodes) && !is_null($objDbRow->GetColumn($strAliasPrefix . 'variableasobjecttype__id'))) {
             if ($intPreviousChildItemCount = count($objPreviousItem->_objVariableAsObjectTypeArray)) {
                 $objPreviousChildItem = $objPreviousItem->_objVariableAsObjectTypeArray[$intPreviousChildItemCount - 1];
                 $objChildItem = Variable::InstantiateDbRow($objDbRow, $strAliasPrefix . 'variableasobjecttype__', $strExpandAsArrayNodes, $objPreviousChildItem);
                 if ($objChildItem) {
                     array_push($objPreviousItem->_objVariableAsObjectTypeArray, $objChildItem);
                 }
             } else {
                 array_push($objPreviousItem->_objVariableAsObjectTypeArray, Variable::InstantiateDbRow($objDbRow, $strAliasPrefix . 'variableasobjecttype__', $strExpandAsArrayNodes));
             }
             $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 == 'qcodo_class__') {
                 $strAliasPrefix = null;
//.........这里部分代码省略.........
开发者ID:qcodo,项目名称:qcodo-api,代码行数:101,代码来源:QcodoClassGen.class.php


注:本文中的Variable::InstantiateDbRow方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。