• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP DatabaseRowBase类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: InstantiateDbRow

 /**
  * Instantiate an Item from a Database Row.
  * Takes in an optional strAliasPrefix, used in case another Object::InstantiateDbRow
  * @param DatabaseRowBase $objDbRow
  * @param string $strAliasPrefix
  * @return Shipment
  */
 public static function InstantiateDbRow($objDbRow, $strAliasPrefix = null)
 {
     // If blank row, return null
     if (!$objDbRow) {
         return null;
     }
     // Create a new instance of the Shipment object
     $objToReturn = new Item();
     $objToReturn->strShortDescription = $objDbRow->GetColumn($strAliasPrefix . 'short_description', 'VarChar');
     $objToReturn->strCode = $objDbRow->GetColumn($strAliasPrefix . 'code', 'VarChar');
     $objToReturn->strQuantity = $objDbRow->GetColumn($strAliasPrefix . 'quantity', 'VarChar');
     $objToReturn->strReceiptNumber = $objDbRow->GetColumn($strAliasPrefix . 'receipt_number', 'VarChar');
     return $objToReturn;
 }
开发者ID:heshuai64,项目名称:einv2,代码行数:21,代码来源:Item.class.php


示例2: InstantiateDbRow

 /**
  * Instantiate a WpPostmeta from a Database Row.
  * Takes in an optional strAliasPrefix, used in case another Object::InstantiateDbRow
  * is calling this WpPostmeta::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 WpPostmeta
  */
 public static function InstantiateDbRow($objDbRow, $strAliasPrefix = null, $strExpandAsArrayNodes = null, $arrPreviousItems = null, $strColumnAliasArray = array())
 {
     // If blank row, return null
     if (!$objDbRow) {
         return null;
     }
     // Create a new instance of the WpPostmeta object
     $objToReturn = new WpPostmeta();
     $objToReturn->__blnRestored = true;
     $strAlias = $strAliasPrefix . 'meta_id';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     $objToReturn->intMetaId = $objDbRow->GetColumn($strAliasName, 'Integer');
     $strAlias = $strAliasPrefix . 'post_id';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     $objToReturn->intPostId = $objDbRow->GetColumn($strAliasName, 'Integer');
     $strAlias = $strAliasPrefix . 'meta_key';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     $objToReturn->strMetaKey = $objDbRow->GetColumn($strAliasName, 'VarChar');
     $strAlias = $strAliasPrefix . 'meta_value';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     $objToReturn->strMetaValue = $objDbRow->GetColumn($strAliasName, 'Blob');
     if (isset($arrPreviousItems) && is_array($arrPreviousItems)) {
         foreach ($arrPreviousItems as $objPreviousItem) {
             if ($objToReturn->MetaId != $objPreviousItem->MetaId) {
                 continue;
             }
             // complete match - all primary key columns are the same
             return null;
         }
     }
     // Instantiate Virtual Attributes
     $strVirtualPrefix = $strAliasPrefix . '__';
     $strVirtualPrefixLength = strlen($strVirtualPrefix);
     foreach ($objDbRow->GetColumnNameArray() as $strColumnName => $mixValue) {
         if (strncmp($strColumnName, $strVirtualPrefix, $strVirtualPrefixLength) == 0) {
             $objToReturn->__strVirtualAttributeArray[substr($strColumnName, $strVirtualPrefixLength)] = $mixValue;
         }
     }
     // Prepare to Check for Early/Virtual Binding
     if (!$strAliasPrefix) {
         $strAliasPrefix = 'wp_postmeta__';
     }
     // Check for Post Early Binding
     $strAlias = $strAliasPrefix . 'post_id__ID';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     if (!is_null($objDbRow->GetColumn($strAliasName))) {
         $objToReturn->objPost = WpPosts::InstantiateDbRow($objDbRow, $strAliasPrefix . 'post_id__', $strExpandAsArrayNodes, null, $strColumnAliasArray);
     }
     return $objToReturn;
 }
开发者ID:hiptc,项目名称:dle2wordpress,代码行数:62,代码来源:WpPostmetaGen.class.php


示例3: InstantiateDbRow

 /**
  * Instantiate a InventoryModel from a Database Row.
  * Takes in an optional strAliasPrefix, used in case another Object::InstantiateDbRow
  * is calling this InventoryModel::InstantiateDbRow in order to perform
  * early binding on referenced objects.
  * @param DatabaseRowBase $objDbRow
  * @param string $strAliasPrefix
  * @return InventoryModel
  */
 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->intInventoryModelId == $objDbRow->GetColumn($strAliasPrefix . 'inventory_model_id', 'Integer')) {
         // We are.  Now, prepare to check for ExpandAsArray clauses
         $blnExpandedViaArray = false;
         if (!$strAliasPrefix) {
             $strAliasPrefix = 'inventory_model__';
         }
         if (array_key_exists($strAliasPrefix . 'inventorylocation__inventory_location_id', $strExpandAsArrayNodes) && !is_null($objDbRow->GetColumn($strAliasPrefix . 'inventorylocation__inventory_location_id'))) {
             if ($intPreviousChildItemCount = count($objPreviousItem->_objInventoryLocationArray)) {
                 $objPreviousChildItem = $objPreviousItem->_objInventoryLocationArray[$intPreviousChildItemCount - 1];
                 $objChildItem = InventoryLocation::InstantiateDbRow($objDbRow, $strAliasPrefix . 'inventorylocation__', $strExpandAsArrayNodes, $objPreviousChildItem);
                 if ($objChildItem) {
                     array_push($objPreviousItem->_objInventoryLocationArray, $objChildItem);
                 }
             } else {
                 array_push($objPreviousItem->_objInventoryLocationArray, InventoryLocation::InstantiateDbRow($objDbRow, $strAliasPrefix . 'inventorylocation__', $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 == 'inventory_model__') {
                 $strAliasPrefix = null;
             }
         }
     }
     // Create a new instance of the InventoryModel object
     $objToReturn = new InventoryModel();
     $objToReturn->__blnRestored = true;
     $objToReturn->intInventoryModelId = $objDbRow->GetColumn($strAliasPrefix . 'inventory_model_id', 'Integer');
     $objToReturn->intCategoryId = $objDbRow->GetColumn($strAliasPrefix . 'category_id', 'Integer');
     $objToReturn->intManufacturerId = $objDbRow->GetColumn($strAliasPrefix . 'manufacturer_id', 'Integer');
     $objToReturn->strInventoryModelCode = $objDbRow->GetColumn($strAliasPrefix . 'inventory_model_code', 'VarChar');
     $objToReturn->strShortDescription = $objDbRow->GetColumn($strAliasPrefix . 'short_description', 'VarChar');
     $objToReturn->strLongDescription = $objDbRow->GetColumn($strAliasPrefix . 'long_description', 'Blob');
     $objToReturn->strImagePath = $objDbRow->GetColumn($strAliasPrefix . 'image_path', 'VarChar');
     $objToReturn->fltPrice = $objDbRow->GetColumn($strAliasPrefix . 'price', 'Float');
     $objToReturn->intCreatedBy = $objDbRow->GetColumn($strAliasPrefix . 'created_by', 'Integer');
     $objToReturn->dttCreationDate = $objDbRow->GetColumn($strAliasPrefix . 'creation_date', 'DateTime');
     $objToReturn->intModifiedBy = $objDbRow->GetColumn($strAliasPrefix . 'modified_by', 'Integer');
     $objToReturn->strModifiedDate = $objDbRow->GetColumn($strAliasPrefix . 'modified_date', 'VarChar');
     // 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 = 'inventory_model__';
     }
     // Check for Category Early Binding
     if (!is_null($objDbRow->GetColumn($strAliasPrefix . 'category_id__category_id'))) {
         $objToReturn->objCategory = Category::InstantiateDbRow($objDbRow, $strAliasPrefix . 'category_id__', $strExpandAsArrayNodes);
     }
     // Check for Manufacturer Early Binding
     if (!is_null($objDbRow->GetColumn($strAliasPrefix . 'manufacturer_id__manufacturer_id'))) {
         $objToReturn->objManufacturer = Manufacturer::InstantiateDbRow($objDbRow, $strAliasPrefix . 'manufacturer_id__', $strExpandAsArrayNodes);
     }
     // Check for CreatedByObject Early Binding
     if (!is_null($objDbRow->GetColumn($strAliasPrefix . 'created_by__user_account_id'))) {
         $objToReturn->objCreatedByObject = UserAccount::InstantiateDbRow($objDbRow, $strAliasPrefix . 'created_by__', $strExpandAsArrayNodes);
     }
     // Check for ModifiedByObject Early Binding
     if (!is_null($objDbRow->GetColumn($strAliasPrefix . 'modified_by__user_account_id'))) {
         $objToReturn->objModifiedByObject = UserAccount::InstantiateDbRow($objDbRow, $strAliasPrefix . 'modified_by__', $strExpandAsArrayNodes);
     }
     // Check for InventoryLocation Virtual Binding
     if (!is_null($objDbRow->GetColumn($strAliasPrefix . 'inventorylocation__inventory_location_id'))) {
         if ($strExpandAsArrayNodes && array_key_exists($strAliasPrefix . 'inventorylocation__inventory_location_id', $strExpandAsArrayNodes)) {
             array_push($objToReturn->_objInventoryLocationArray, InventoryLocation::InstantiateDbRow($objDbRow, $strAliasPrefix . 'inventorylocation__', $strExpandAsArrayNodes));
         } else {
             $objToReturn->_objInventoryLocation = InventoryLocation::InstantiateDbRow($objDbRow, $strAliasPrefix . 'inventorylocation__', $strExpandAsArrayNodes);
         }
     }
     return $objToReturn;
 }
开发者ID:heshuai64,项目名称:einv2,代码行数:96,代码来源:InventoryModelGen.class.php


示例4: 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


示例5: InstantiateDbRow

 /**
  * Instantiate a Articlemusictracks from a Database Row.
  * Takes in an optional strAliasPrefix, used in case another Object::InstantiateDbRow
  * is calling this Articlemusictracks::InstantiateDbRow in order to perform
  * early binding on referenced objects.
  * @param DatabaseRowBase $objDbRow
  * @param string $strAliasPrefix
  * @param string $strExpandAsArrayNodes
  * @param QBaseClass $objPreviousItem
  * @param string[] $strColumnAliasArray
  * @return Articlemusictracks
  */
 public static function InstantiateDbRow($objDbRow, $strAliasPrefix = null, $strExpandAsArrayNodes = null, $objPreviousItem = null, $strColumnAliasArray = array())
 {
     // If blank row, return null
     if (!$objDbRow) {
         return null;
     }
     // Create a new instance of the Articlemusictracks object
     $objToReturn = new Articlemusictracks();
     $objToReturn->__blnRestored = true;
     $strAliasName = array_key_exists($strAliasPrefix . 'id', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'id'] : $strAliasPrefix . 'id';
     $objToReturn->intId = $objDbRow->GetColumn($strAliasName, 'Integer');
     $strAliasName = array_key_exists($strAliasPrefix . 'ReferenceId', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'ReferenceId'] : $strAliasPrefix . 'ReferenceId';
     $objToReturn->intReferenceId = $objDbRow->GetColumn($strAliasName, 'Integer');
     $strAliasName = array_key_exists($strAliasPrefix . 'DiscNumber', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'DiscNumber'] : $strAliasPrefix . 'DiscNumber';
     $objToReturn->strDiscNumber = $objDbRow->GetColumn($strAliasName, 'VarChar');
     $strAliasName = array_key_exists($strAliasPrefix . 'TrackNumber', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'TrackNumber'] : $strAliasPrefix . 'TrackNumber';
     $objToReturn->strTrackNumber = $objDbRow->GetColumn($strAliasName, 'VarChar');
     $strAliasName = array_key_exists($strAliasPrefix . 'TrackTitle', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'TrackTitle'] : $strAliasPrefix . 'TrackTitle';
     $objToReturn->strTrackTitle = $objDbRow->GetColumn($strAliasName, 'Blob');
     // 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 = 'articlemusictracks__';
     }
     // Check for ReferenceIdObject Early Binding
     $strAlias = $strAliasPrefix . 'ReferenceId__id';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     if (!is_null($objDbRow->GetColumn($strAliasName))) {
         $objToReturn->objReferenceIdObject = Articlemusic::InstantiateDbRow($objDbRow, $strAliasPrefix . 'ReferenceId__', $strExpandAsArrayNodes, null, $strColumnAliasArray);
     }
     return $objToReturn;
 }
开发者ID:sarapsg,项目名称:prayuj,代码行数:51,代码来源:ArticlemusictracksGen.class.php


示例6: InstantiateDbRow

 /**
  * Instantiate a Timezone from a Database Row.
  * Takes in an optional strAliasPrefix, used in case another Object::InstantiateDbRow
  * is calling this Timezone::InstantiateDbRow in order to perform
  * early binding on referenced objects.
  * @param DatabaseRowBase $objDbRow
  * @param string $strAliasPrefix
  * @param string $strExpandAsArrayNodes
  * @param QBaseClass $objPreviousItem
  * @param string[] $strColumnAliasArray
  * @return Timezone
  */
 public static function InstantiateDbRow($objDbRow, $strAliasPrefix = null, $strExpandAsArrayNodes = null, $objPreviousItem = 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 . 'id';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     if ($strExpandAsArrayNodes && $objPreviousItem && $objPreviousItem->intId == $objDbRow->GetColumn($strAliasName, 'Integer')) {
         // We are.  Now, prepare to check for ExpandAsArray clauses
         $blnExpandedViaArray = false;
         if (!$strAliasPrefix) {
             $strAliasPrefix = 'timezone__';
         }
         $strAlias = $strAliasPrefix . 'person__id';
         $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
         if (array_key_exists($strAlias, $strExpandAsArrayNodes) && !is_null($objDbRow->GetColumn($strAliasName))) {
             if ($intPreviousChildItemCount = count($objPreviousItem->_objPersonArray)) {
                 $objPreviousChildItem = $objPreviousItem->_objPersonArray[$intPreviousChildItemCount - 1];
                 $objChildItem = Person::InstantiateDbRow($objDbRow, $strAliasPrefix . 'person__', $strExpandAsArrayNodes, $objPreviousChildItem, $strColumnAliasArray);
                 if ($objChildItem) {
                     $objPreviousItem->_objPersonArray[] = $objChildItem;
                 }
             } else {
                 $objPreviousItem->_objPersonArray[] = Person::InstantiateDbRow($objDbRow, $strAliasPrefix . 'person__', $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 == 'timezone__') {
                 $strAliasPrefix = null;
             }
         }
     }
     // Create a new instance of the Timezone object
     $objToReturn = new Timezone();
     $objToReturn->__blnRestored = true;
     $strAliasName = array_key_exists($strAliasPrefix . 'id', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'id'] : $strAliasPrefix . 'id';
     $objToReturn->intId = $objDbRow->GetColumn($strAliasName, 'Integer');
     $strAliasName = array_key_exists($strAliasPrefix . 'name', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'name'] : $strAliasPrefix . 'name';
     $objToReturn->strName = $objDbRow->GetColumn($strAliasName, 'VarChar');
     // 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 = 'timezone__';
     }
     // Check for Person Virtual Binding
     $strAlias = $strAliasPrefix . 'person__id';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     if (!is_null($objDbRow->GetColumn($strAliasName))) {
         if ($strExpandAsArrayNodes && array_key_exists($strAlias, $strExpandAsArrayNodes)) {
             $objToReturn->_objPersonArray[] = Person::InstantiateDbRow($objDbRow, $strAliasPrefix . 'person__', $strExpandAsArrayNodes, null, $strColumnAliasArray);
         } else {
             $objToReturn->_objPerson = Person::InstantiateDbRow($objDbRow, $strAliasPrefix . 'person__', $strExpandAsArrayNodes, null, $strColumnAliasArray);
         }
     }
     return $objToReturn;
 }
开发者ID:klucznik,项目名称:qcodo-website,代码行数:81,代码来源:TimezoneGen.class.php


示例7: InstantiateDbRow

 /**
  * Instantiate a NarroSuggestionVote from a Database Row.
  * Takes in an optional strAliasPrefix, used in case another Object::InstantiateDbRow
  * is calling this NarroSuggestionVote::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 NarroSuggestionVote
  */
 public static function InstantiateDbRow($objDbRow, $strAliasPrefix = null, $strExpandAsArrayNodes = null, $arrPreviousItems = null, $strColumnAliasArray = array())
 {
     // If blank row, return null
     if (!$objDbRow) {
         return null;
     }
     // Create a new instance of the NarroSuggestionVote object
     $objToReturn = new NarroSuggestionVote();
     $objToReturn->__blnRestored = true;
     $strAlias = $strAliasPrefix . 'suggestion_id';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     $objToReturn->intSuggestionId = $objDbRow->GetColumn($strAliasName, 'Integer');
     $objToReturn->__intSuggestionId = $objDbRow->GetColumn($strAliasName, 'Integer');
     $strAlias = $strAliasPrefix . 'context_id';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     $objToReturn->intContextId = $objDbRow->GetColumn($strAliasName, 'Integer');
     $objToReturn->__intContextId = $objDbRow->GetColumn($strAliasName, 'Integer');
     $strAlias = $strAliasPrefix . 'user_id';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     $objToReturn->intUserId = $objDbRow->GetColumn($strAliasName, 'Integer');
     $objToReturn->__intUserId = $objDbRow->GetColumn($strAliasName, 'Integer');
     $strAlias = $strAliasPrefix . 'vote_value';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     $objToReturn->intVoteValue = $objDbRow->GetColumn($strAliasName, 'Integer');
     $strAlias = $strAliasPrefix . 'created';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     $objToReturn->dttCreated = $objDbRow->GetColumn($strAliasName, 'DateTime');
     $strAlias = $strAliasPrefix . 'modified';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     $objToReturn->dttModified = $objDbRow->GetColumn($strAliasName, 'DateTime');
     if (isset($arrPreviousItems) && is_array($arrPreviousItems)) {
         foreach ($arrPreviousItems as $objPreviousItem) {
             if ($objToReturn->SuggestionId != $objPreviousItem->SuggestionId) {
                 continue;
             }
             if ($objToReturn->ContextId != $objPreviousItem->ContextId) {
                 continue;
             }
             if ($objToReturn->UserId != $objPreviousItem->UserId) {
                 continue;
             }
             // complete match - all primary key columns are the same
             return null;
         }
     }
     // Instantiate Virtual Attributes
     $strVirtualPrefix = $strAliasPrefix . '__';
     $strVirtualPrefixLength = strlen($strVirtualPrefix);
     foreach ($objDbRow->GetColumnNameArray() as $strColumnName => $mixValue) {
         if (strncmp($strColumnName, $strVirtualPrefix, $strVirtualPrefixLength) == 0) {
             $objToReturn->__strVirtualAttributeArray[substr($strColumnName, $strVirtualPrefixLength)] = $mixValue;
         }
     }
     // Prepare to Check for Early/Virtual Binding
     if (!$strAliasPrefix) {
         $strAliasPrefix = 'narro_suggestion_vote__';
     }
     // Check for Suggestion Early Binding
     $strAlias = $strAliasPrefix . 'suggestion_id__suggestion_id';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     if (!is_null($objDbRow->GetColumn($strAliasName))) {
         $objToReturn->objSuggestion = NarroSuggestion::InstantiateDbRow($objDbRow, $strAliasPrefix . 'suggestion_id__', $strExpandAsArrayNodes, null, $strColumnAliasArray);
     }
     // Check for Context Early Binding
     $strAlias = $strAliasPrefix . 'context_id__context_id';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     if (!is_null($objDbRow->GetColumn($strAliasName))) {
         $objToReturn->objContext = NarroContext::InstantiateDbRow($objDbRow, $strAliasPrefix . 'context_id__', $strExpandAsArrayNodes, null, $strColumnAliasArray);
     }
     // Check for User Early Binding
     $strAlias = $strAliasPrefix . 'user_id__user_id';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     if (!is_null($objDbRow->GetColumn($strAliasName))) {
         $objToReturn->objUser = NarroUser::InstantiateDbRow($objDbRow, $strAliasPrefix . 'user_id__', $strExpandAsArrayNodes, null, $strColumnAliasArray);
     }
     return $objToReturn;
 }
开发者ID:Jobava,项目名称:narro,代码行数:89,代码来源:NarroSuggestionVoteGen.class.php


示例8: InstantiateDbRow

 /**
  * Instantiate a TransactionType from a Database Row.
  * Takes in an optional strAliasPrefix, used in case another Object::InstantiateDbRow
  * is calling this TransactionType::InstantiateDbRow in order to perform
  * early binding on referenced objects.
  * @param DatabaseRowBase $objDbRow
  * @param string $strAliasPrefix
  * @return TransactionType
  */
 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->intTransactionTypeId == $objDbRow->GetColumn($strAliasPrefix . 'transaction_type_id', 'Integer')) {
         // We are.  Now, prepare to check for ExpandAsArray clauses
         $blnExpandedViaArray = false;
         if (!$strAliasPrefix) {
             $strAliasPrefix = 'transaction_type__';
         }
         if (array_key_exists($strAliasPrefix . 'transaction__transaction_id', $strExpandAsArrayNodes) && !is_null($objDbRow->GetColumn($strAliasPrefix . 'transaction__transaction_id'))) {
             if ($intPreviousChildItemCount = count($objPreviousItem->_objTransactionArray)) {
                 $objPreviousChildItem = $objPreviousItem->_objTransactionArray[$intPreviousChildItemCount - 1];
                 $objChildItem = Transaction::InstantiateDbRow($objDbRow, $strAliasPrefix . 'transaction__', $strExpandAsArrayNodes, $objPreviousChildItem);
                 if ($objChildItem) {
                     array_push($objPreviousItem->_objTransactionArray, $objChildItem);
                 }
             } else {
                 array_push($objPreviousItem->_objTransactionArray, Transaction::InstantiateDbRow($objDbRow, $strAliasPrefix . 'transaction__', $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 == 'transaction_type__') {
                 $strAliasPrefix = null;
             }
         }
     }
     // Create a new instance of the TransactionType object
     $objToReturn = new TransactionType();
     $objToReturn->__blnRestored = true;
     $objToReturn->intTransactionTypeId = $objDbRow->GetColumn($strAliasPrefix . 'transaction_type_id', 'Integer');
     $objToReturn->strShortDescription = $objDbRow->GetColumn($strAliasPrefix . 'short_description', 'VarChar');
     $objToReturn->blnAssetFlag = $objDbRow->GetColumn($strAliasPrefix . 'asset_flag', 'Bit');
     $objToReturn->blnInventoryFlag = $objDbRow->GetColumn($strAliasPrefix . 'inventory_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 = 'transaction_type__';
     }
     // Check for Transaction Virtual Binding
     if (!is_null($objDbRow->GetColumn($strAliasPrefix . 'transaction__transaction_id'))) {
         if ($strExpandAsArrayNodes && array_key_exists($strAliasPrefix . 'transaction__transaction_id', $strExpandAsArrayNodes)) {
             array_push($objToReturn->_objTransactionArray, Transaction::InstantiateDbRow($objDbRow, $strAliasPrefix . 'transaction__', $strExpandAsArrayNodes));
         } else {
             $objToReturn->_objTransaction = Transaction::InstantiateDbRow($objDbRow, $strAliasPrefix . 'transaction__', $strExpandAsArrayNodes);
         }
     }
     return $objToReturn;
 }
开发者ID:heshuai64,项目名称:einv2,代码行数:72,代码来源:TransactionTypeGen.class.php


示例9: InstantiateDbRow

 /**
  * Instantiate a DleRssinform from a Database Row.
  * Takes in an optional strAliasPrefix, used in case another Object::InstantiateDbRow
  * is calling this DleRssinform::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 DleRssinform
  */
 public static function InstantiateDbRow($objDbRow, $strAliasPrefix = null, $strExpandAsArrayNodes = null, $arrPreviousItems = null, $strColumnAliasArray = array())
 {
     // If blank row, return null
     if (!$objDbRow) {
         return null;
     }
     // Create a new instance of the DleRssinform object
     $objToReturn = new DleRssinform();
     $objToReturn->__blnRestored = true;
     $strAlias = $strAliasPrefix . 'id';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     $objToReturn->intId = $objDbRow->GetColumn($strAliasName, 'Integer');
     $strAlias = $strAliasPrefix . 'tag';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     $objToReturn->strTag = $objDbRow->GetColumn($strAliasName, 'VarChar');
     $strAlias = $strAliasPrefix . 'descr';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     $objToReturn->strDescr = $objDbRow->GetColumn($strAliasName, 'VarChar');
     $strAlias = $strAliasPrefix . 'category';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     $objToReturn->strCategory = $objDbRow->GetColumn($strAliasName, 'VarChar');
     $strAlias = $strAliasPrefix . 'url';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     $objToReturn->strUrl = $objDbRow->GetColumn($strAliasName, 'VarChar');
     $strAlias = $strAliasPrefix . 'template';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     $objToReturn->strTemplate = $objDbRow->GetColumn($strAliasName, 'VarChar');
     $strAlias = $strAliasPrefix . 'news_max';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     $objToReturn->intNewsMax = $objDbRow->GetColumn($strAliasName, 'Integer');
     $strAlias = $strAliasPrefix . 'tmax';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     $objToReturn->intTmax = $objDbRow->GetColumn($strAliasName, 'Integer');
     $strAlias = $strAliasPrefix . 'dmax';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     $objToReturn->intDmax = $objDbRow->GetColumn($strAliasName, 'Integer');
     $strAlias = $strAliasPrefix . 'approve';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     $objToReturn->blnApprove = $objDbRow->GetColumn($strAliasName, 'Bit');
     $strAlias = $strAliasPrefix . 'rss_date_format';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     $objToReturn->strRssDateFormat = $objDbRow->GetColumn($strAliasName, 'VarChar');
     if (isset($arrPreviousItems) && is_array($arrPreviousItems)) {
         foreach ($arrPreviousItems as $objPreviousItem) {
             if ($objToReturn->Id != $objPreviousItem->Id) {
                 continue;
             }
             // complete match - all primary key columns are the same
             return null;
         }
     }
     // Instantiate Virtual Attributes
     $strVirtualPrefix = $strAliasPrefix . '__';
     $strVirtualPrefixLength = strlen($strVirtualPrefix);
     foreach ($objDbRow->GetColumnNameArray() as $strColumnName => $mixValue) {
         if (strncmp($strColumnName, $strVirtualPrefix, $strVirtualPrefixLength) == 0) {
             $objToReturn->__strVirtualAttributeArray[substr($strColumnName, $strVirtualPrefixLength)] = $mixValue;
         }
     }
     // Prepare to Check for Early/Virtual Binding
     if (!$strAliasPrefix) {
         $strAliasPrefix = 'dle_rssinform__';
     }
     return $objToReturn;
 }
开发者ID:hiptc,项目名称:dle2wordpress,代码行数:77,代码来源:DleRssinformGen.class.php


示例10: InstantiateDbRow

 /**
  * Instantiate a VariableGroup from a Database Row.
  * Takes in an optional strAliasPrefix, used in case another Object::InstantiateDbRow
  * is calling this VariableGroup::InstantiateDbRow in order to perform
  * early binding on referenced objects.
  * @param DatabaseRowBase $objDbRow
  * @param string $strAliasPrefix
  * @return VariableGroup
  */
 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 = 'variable_group__';
         }
         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;
         }
         // Either return false to signal array expansion, or check-to-reset the Alias prefix and move on
         if ($blnExpandedViaArray) {
             return false;
         } else {
             if ($strAliasPrefix == 'variable_group__') {
                 $strAliasPrefix = null;
             }
         }
     }
     // Create a new instance of the VariableGroup object
     $objToReturn = new VariableGroup();
     $objToReturn->__blnRestored = true;
     $objToReturn->intId = $objDbRow->GetColumn($strAliasPrefix . 'id', 'Integer');
     $objToReturn->strName = $objDbRow->GetColumn($strAliasPrefix . 'name', 'VarChar');
     $objToReturn->intOrderNumber = $objDbRow->GetColumn($strAliasPrefix . 'order_number', '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 = 'variable_group__';
     }
     // 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);
         }
     }
     // Check for ClassVariable Virtual Binding
     if (!is_null($objDbRow->GetColumn($strAliasPrefix . 'classvariable__id'))) {
         if ($strExpandAsArrayNodes && array_key_exists($strAliasPrefix . 'classvariable__id', $strExpandAsArrayNodes)) {
             array_push($objToReturn->_objClassVariableArray, ClassVariable::InstantiateDbRow($objDbRow, $strAliasPrefix . 'classvariable__', $strExpandAsArrayNodes));
         } else {
             $objToReturn->_objClassVariable = ClassVariable::InstantiateDbRow($objDbRow, $strAliasPrefix . 'classvariable__', $strExpandAsArrayNodes);
         }
     }
     return $objToReturn;
 }
开发者ID:qcodo,项目名称:qcodo-api,代码行数:91,代码来源:VariableGroupGen.class.php


示例11: InstantiateDbRow

 /**
  * Instantiate a NarroLog from a Database Row.
  * Takes in an optional strAliasPrefix, used in case another Object::InstantiateDbRow
  * is calling this NarroLog::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 NarroLog
  */
 public static function InstantiateDbRow($objDbRow, $strAliasPrefix = null, $strExpandAsArrayNodes = null, $arrPreviousItems = null, $strColumnAliasArray = array())
 {
     // If blank row, return null
     if (!$objDbRow) {
         return null;
     }
     // Create a new instance of the NarroLog object
     $objToReturn = new NarroLog();
     $objToReturn->__blnRestored = true;
     $strAlias = $strAliasPrefix . 'log_id';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     $objToReturn->intLogId = $objDbRow->GetColumn($strAliasName, 'Integer');
     $strAlias = $strAliasPrefix . 'language_id';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     $objToReturn->intLanguageId = $objDbRow->GetColumn($strAliasName, 'Integer');
     $strAlias = $strAliasPrefix . 'project_id';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     $objToReturn->intProjectId = $objDbRow->GetColumn($strAliasName, 'Integer');
     $strAlias = $strAliasPrefix . 'user_id';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     $objToReturn->intUserId = $objDbRow->GetColumn($strAliasName, 'Integer');
     $strAlias = $strAliasPrefix . 'message';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     $objToReturn->strMessage = $objDbRow->GetColumn($strAliasName, 'Blob');
     $strAlias = $strAliasPrefix . 'priority';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     $objToReturn->intPriority = $objDbRow->GetColumn($strAliasName, 'Integer');
     $strAlias = $strAliasPrefix . 'date';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     $objToReturn->dttDate = $objDbRow->GetColumn($strAliasName, 'DateTime');
     if (isset($arrPreviousItems) && is_array($arrPreviousItems)) {
         foreach ($arrPreviousItems as $objPreviousItem) {
             if ($objToReturn->LogId != $objPreviousItem->LogId) {
                 continue;
             }
             // complete match - all primary key columns are the same
             return null;
         }
     }
     // Instantiate Virtual Attributes
     $strVirtualPrefix = $strAliasPrefix . '__';
     $strVirtualPrefixLength = strlen($strVirtualPrefix);
     foreach ($objDbRow->GetColumnNameArray() as $strColumnName => $mixValue) {
         if (strncmp($strColumnName, $strVirtualPrefix, $strVirtualPrefixLength) == 0) {
             $objToReturn->__strVirtualAttributeArray[substr($strColumnName, $strVirtualPrefixLength)] = $mixValue;
         }
     }
     // Prepare to Check for Early/Virtual Binding
     if (!$strAliasPrefix) {
         $strAliasPrefix = 'narro_log__';
     }
     // Check for Language Early Binding
     $strAlias = $strAliasPrefix . 'language_id__language_id';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     if (!is_null($objDbRow->GetColumn($strAliasName))) {
         $objToReturn->objLanguage = NarroLanguage::InstantiateDbRow($objDbRow, $strAliasPrefix . 'language_id__', $strExpandAsArrayNodes, null, $strColumnAliasArray);
     }
     // Check for Project Early Binding
     $strAlias = $strAliasPrefix . 'project_id__project_id';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     if (!is_null($objDbRow->GetColumn($strAliasName))) {
         $objToReturn->objProject = NarroProject::InstantiateDbRow($objDbRow, $strAliasPrefix . 'project_id__', $strExpandAsArrayNodes, null, $strColumnAliasArray);
     }
     // Check for User Early Binding
     $strAlias = $strAliasPrefix . 'user_id__user_id';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     if (!is_null($objDbRow->GetColumn($strAliasName))) {
         $objToReturn->objUser = NarroUser::InstantiateDbRow($objDbRow, $strAliasPrefix . 'user_id__', $strExpandAsArrayNodes, null, $strColumnAliasArray);
     }
     return $objToReturn;
 }
开发者ID:Jobava,项目名称:narro,代码行数:83,代码来源:NarroLogGen.class.php


示例12: InstantiateDbRow

 /**
  * Instantiate a RoleModule from a Database Row.
  * Takes in an optional strAliasPrefix, used in case another Object::InstantiateDbRow
  * is calling this RoleModule::InstantiateDbRow in order to perform
  * early binding on referenced objects.
  * @param DatabaseRowBase $objDbRow
  * @param string $strAliasPrefix
  * @return RoleModule
  */
 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->intRoleModuleId == $objDbRow->GetColumn($strAliasPrefix . 'role_module_id', 'Integer')) {
         // We are.  Now, prepare to check for ExpandAsArray clauses
         $blnExpandedViaArray = false;
         if (!$strAliasPrefix) {
             $strAliasPrefix = 'role_module__';
         }
         if (array_key_exists($strAliasPrefix . 'rolemoduleauthorization__role_module_authorization_id', $strExpandAsArrayNodes) && !is_null($objDbRow->GetColumn($strAliasPrefix . 'rolemoduleauthorization__role_module_authorization_id'))) {
             if ($intPreviousChildItemCount = count($objPreviousItem->_objRoleModuleAuthorizationArray)) {
                 $objPreviousChildItem = $objPreviousItem->_objRoleModuleAuthorizationArray[$intPreviousChildItemCount - 1];
                 $objChildItem = RoleModuleAuthorization::InstantiateDbRow($objDbRow, $strAliasPrefix . 'rolemoduleauthorization__', $strExpandAsArrayNodes, $objP 

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP DatabaseTest类代码示例发布时间:2022-05-23
下一篇:
PHP DatabaseOperation类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap