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


PHP QDatabaseRowBase类代码示例

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


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

示例1: InstantiateDbRow

 /**
  * Instantiate a ParentPagerIndividual from a Database Row.
  * Takes in an optional strAliasPrefix, used in case another Object::InstantiateDbRow
  * is calling this ParentPagerIndividual::InstantiateDbRow in order to perform
  * early binding on referenced objects.
  * @param QDatabaseRowBase $objDbRow
  * @param string $strAliasPrefix
  * @param string $strExpandAsArrayNodes
  * @param QBaseClass $objPreviousItem
  * @param string[] $strColumnAliasArray
  * @return ParentPagerIndividual
  */
 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 = 'parent_pager_individual__';
         }
         $strAlias = $strAliasPrefix . 'parentpageraddress__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->_objParentPagerAddressArray)) {
                 $objPreviousChildItem = $objPreviousItem->_objParentPagerAddressArray[$intPreviousChildItemCount - 1];
                 $objChildItem = ParentPagerAddress::InstantiateDbRow($objDbRow, $strAliasPrefix . 'parentpageraddress__', $strExpandAsArrayNodes, $objPreviousChildItem, $strColumnAliasArray);
                 if ($objChildItem) {
                     $objPreviousItem->_objParentPagerAddressArray[] = $objChildItem;
                 }
             } else {
                 $objPreviousItem->_objParentPagerAddressArray[] = ParentPagerAddress::InstantiateDbRow($objDbRow, $strAliasPrefix . 'parentpageraddress__', $strExpandAsArrayNodes, null, $strColumnAliasArray);
             }
             $blnExpandedViaArray = true;
         }
         $strAlias = $strAliasPrefix . 'parentpagerattendanthistory__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->_objParentPagerAttendantHistoryArray)) {
                 $objPreviousChildItem = $objPreviousItem->_objParentPagerAttendantHistoryArray[$intPreviousChildItemCount - 1];
                 $objChildItem = ParentPagerAttendantHistory::InstantiateDbRow($objDbRow, $strAliasPrefix . 'parentpagerattendanthistory__', $strExpandAsArrayNodes, $objPreviousChildItem, $strColumnAliasArray);
                 if ($objChildItem) {
                     $objPreviousItem->_objParentPagerAttendantHistoryArray[] = $objChildItem;
                 }
             } else {
                 $objPreviousItem->_objParentPagerAttendantHistoryArray[] = ParentPagerAttendantHistory::InstantiateDbRow($objDbRow, $strAliasPrefix . 'parentpagerattendanthistory__', $strExpandAsArrayNodes, null, $strColumnAliasArray);
             }
             $blnExpandedViaArray = true;
         }
         $strAlias = $strAliasPrefix . 'parentpagerchildhistoryaspickupby__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->_objParentPagerChildHistoryAsPickupByArray)) {
                 $objPreviousChildItem = $objPreviousItem->_objParentPagerChildHistoryAsPickupByArray[$intPreviousChildItemCount - 1];
                 $objChildItem = ParentPagerChildHistory::InstantiateDbRow($objDbRow, $strAliasPrefix . 'parentpagerchildhistoryaspickupby__', $strExpandAsArrayNodes, $objPreviousChildItem, $strColumnAliasArray);
                 if ($objChildItem) {
                     $objPreviousItem->_objParentPagerChildHistoryAsPickupByArray[] = $objChildItem;
                 }
             } else {
                 $objPreviousItem->_objParentPagerChildHistoryAsPickupByArray[] = ParentPagerChildHistory::InstantiateDbRow($objDbRow, $strAliasPrefix . 'parentpagerchildhistoryaspickupby__', $strExpandAsArrayNodes, null, $strColumnAliasArray);
             }
             $blnExpandedViaArray = true;
         }
         $strAlias = $strAliasPrefix . 'parentpagerchildhistory__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->_objParentPagerChildHistoryArray)) {
                 $objPreviousChildItem = $objPreviousItem->_objParentPagerChildHistoryArray[$intPreviousChildItemCount - 1];
                 $objChildItem = ParentPagerChildHistory::InstantiateDbRow($objDbRow, $strAliasPrefix . 'parentpagerchildhistory__', $strExpandAsArrayNodes, $objPreviousChildItem, $strColumnAliasArray);
                 if ($objChildItem) {
                     $objPreviousItem->_objParentPagerChildHistoryArray[] = $objChildItem;
                 }
             } else {
                 $objPreviousItem->_objParentPagerChildHistoryArray[] = ParentPagerChildHistory::InstantiateDbRow($objDbRow, $strAliasPrefix . 'parentpagerchildhistory__', $strExpandAsArrayNodes, null, $strColumnAliasArray);
             }
             $blnExpandedViaArray = true;
         }
         $strAlias = $strAliasPrefix . 'parentpagerchildhistoryasdropoffby__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->_objParentPagerChildHistoryAsDropoffByArray)) {
                 $objPreviousChildItem = $objPreviousItem->_objParentPagerChildHistoryAsDropoffByArray[$intPreviousChildItemCount - 1];
                 $objChildItem = ParentPagerChildHistory::InstantiateDbRow($objDbRow, $strAliasPrefix . 'parentpagerchildhistoryasdropoffby__', $strExpandAsArrayNodes, $objPreviousChildItem, $strColumnAliasArray);
                 if ($objChildItem) {
                     $objPreviousItem->_objParentPagerChildHistoryAsDropoffByArray[] = $objChildItem;
                 }
             } else {
                 $objPreviousItem->_objParentPagerChildHistoryAsDropoffByArray[] = ParentPagerChildHistory::InstantiateDbRow($objDbRow, $strAliasPrefix . 'parentpagerchildhistoryasdropoffby__', $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;
//.........这里部分代码省略.........
开发者ID:alcf,项目名称:chms,代码行数:101,代码来源:ParentPagerIndividualGen.class.php

示例2: InstantiateDbRow

 /**
  * Instantiate a IssueFieldOption from a Database Row.
  * Takes in an optional strAliasPrefix, used in case another Object::InstantiateDbRow
  * is calling this IssueFieldOption::InstantiateDbRow in order to perform
  * early binding on referenced objects.
  * @param QDatabaseRowBase $objDbRow
  * @param string $strAliasPrefix
  * @param string $strExpandAsArrayNodes
  * @param QBaseClass $objPreviousItem
  * @param string[] $strColumnAliasArray
  * @return IssueFieldOption
  */
 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 = 'issue_field_option__';
         }
         $strAlias = $strAliasPrefix . 'issuefieldvalue__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->_objIssueFieldValueArray)) {
                 $objPreviousChildItem = $objPreviousItem->_objIssueFieldValueArray[$intPreviousChildItemCount - 1];
                 $objChildItem = IssueFieldValue::InstantiateDbRow($objDbRow, $strAliasPrefix . 'issuefieldvalue__', $strExpandAsArrayNodes, $objPreviousChildItem, $strColumnAliasArray);
                 if ($objChildItem) {
                     $objPreviousItem->_objIssueFieldValueArray[] = $objChildItem;
                 }
             } else {
                 $objPreviousItem->_objIssueFieldValueArray[] = IssueFieldValue::InstantiateDbRow($objDbRow, $strAliasPrefix . 'issuefieldvalue__', $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 == 'issue_field_option__') {
                 $strAliasPrefix = null;
             }
         }
     }
     // Create a new instance of the IssueFieldOption object
     $objToReturn = new IssueFieldOption();
     $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 . 'issue_field_id', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'issue_field_id'] : $strAliasPrefix . 'issue_field_id';
     $objToReturn->intIssueFieldId = $objDbRow->GetColumn($strAliasName, 'Integer');
     $strAliasName = array_key_exists($strAliasPrefix . 'name', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'name'] : $strAliasPrefix . 'name';
     $objToReturn->strName = $objDbRow->GetColumn($strAliasName, 'VarChar');
     $strAliasName = array_key_exists($strAliasPrefix . 'token', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'token'] : $strAliasPrefix . 'token';
     $objToReturn->strToken = $objDbRow->GetColumn($strAliasName, 'VarChar');
     $strAliasName = array_key_exists($strAliasPrefix . 'order_number', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'order_number'] : $strAliasPrefix . 'order_number';
     $objToReturn->intOrderNumber = $objDbRow->GetColumn($strAliasName, 'Integer');
     $strAliasName = array_key_exists($strAliasPrefix . 'active_flag', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'active_flag'] : $strAliasPrefix . 'active_flag';
     $objToReturn->blnActiveFlag = $objDbRow->GetColumn($strAliasName, '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 = 'issue_field_option__';
     }
     // Check for IssueField Early Binding
     $strAlias = $strAliasPrefix . 'issue_field_id__id';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     if (!is_null($objDbRow->GetColumn($strAliasName))) {
         $objToReturn->objIssueField = IssueField::InstantiateDbRow($objDbRow, $strAliasPrefix . 'issue_field_id__', $strExpandAsArrayNodes, null, $strColumnAliasArray);
     }
     // Check for IssueFieldValue Virtual Binding
     $strAlias = $strAliasPrefix . 'issuefieldvalue__id';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     if (!is_null($objDbRow->GetColumn($strAliasName))) {
         if ($strExpandAsArrayNodes && array_key_exists($strAlias, $strExpandAsArrayNodes)) {
             $objToReturn->_objIssueFieldValueArray[] = IssueFieldValue::InstantiateDbRow($objDbRow, $strAliasPrefix . 'issuefieldvalue__', $strExpandAsArrayNodes, null, $strColumnAliasArray);
         } else {
             $objToReturn->_objIssueFieldValue = IssueFieldValue::InstantiateDbRow($objDbRow, $strAliasPrefix . 'issuefieldvalue__', $strExpandAsArrayNodes, null, $strColumnAliasArray);
         }
     }
     return $objToReturn;
 }
开发者ID:qcodo,项目名称:qcodo-website,代码行数:95,代码来源:IssueFieldOptionGen.class.php

示例3: InstantiateDbRow

 /**
  * Instantiate a AssetCustomFieldHelper from a Database Row.
  * Takes in an optional strAliasPrefix, used in case another Object::InstantiateDbRow
  * is calling this AssetCustomFieldHelper::InstantiateDbRow in order to perform
  * early binding on referenced objects.
  * @param QDatabaseRowBase $objDbRow
  * @param string $strAliasPrefix
  * @param string $strExpandAsArrayNodes
  * @param QBaseClass $objPreviousItem
  * @param string[] $strColumnAliasArray
  * @return AssetCustomFieldHelper
  */
 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 AssetCustomFieldHelper object
     $objToReturn = new AssetCustomFieldHelper();
     $objToReturn->__blnRestored = true;
     $strAliasName = array_key_exists($strAliasPrefix . 'asset_id', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'asset_id'] : $strAliasPrefix . 'asset_id';
     $objToReturn->intAssetId = $objDbRow->GetColumn($strAliasName, 'Integer');
     $objToReturn->__intAssetId = $objDbRow->GetColumn($strAliasName, '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 = 'asset_custom_field_helper__';
     }
     // Check for Asset Early Binding
     $strAlias = $strAliasPrefix . 'asset_id__asset_id';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     if (!is_null($objDbRow->GetColumn($strAliasName))) {
         $objToReturn->objAsset = Asset::InstantiateDbRow($objDbRow, $strAliasPrefix . 'asset_id__', $strExpandAsArrayNodes, null, $strColumnAliasArray);
     }
     return $objToReturn;
 }
开发者ID:proxymoron,项目名称:tracmor,代码行数:44,代码来源:AssetCustomFieldHelperGen.class.php

示例4: InstantiateDbRow

 /**
  * Instantiate a StewardshipContributionAmount from a Database Row.
  * Takes in an optional strAliasPrefix, used in case another Object::InstantiateDbRow
  * is calling this StewardshipContributionAmount::InstantiateDbRow in order to perform
  * early binding on referenced objects.
  * @param QDatabaseRowBase $objDbRow
  * @param string $strAliasPrefix
  * @param string $strExpandAsArrayNodes
  * @param QBaseClass $objPreviousItem
  * @param string[] $strColumnAliasArray
  * @return StewardshipContributionAmount
  */
 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 StewardshipContributionAmount object
     $objToReturn = new StewardshipContributionAmount();
     $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 . 'stewardship_contribution_id', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'stewardship_contribution_id'] : $strAliasPrefix . 'stewardship_contribution_id';
     $objToReturn->intStewardshipContributionId = $objDbRow->GetColumn($strAliasName, 'Integer');
     $strAliasName = array_key_exists($strAliasPrefix . 'stewardship_fund_id', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'stewardship_fund_id'] : $strAliasPrefix . 'stewardship_fund_id';
     $objToReturn->intStewardshipFundId = $objDbRow->GetColumn($strAliasName, 'Integer');
     $strAliasName = array_key_exists($strAliasPrefix . 'amount', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'amount'] : $strAliasPrefix . 'amount';
     $objToReturn->fltAmount = $objDbRow->GetColumn($strAliasName, 'Float');
     // 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 = 'stewardship_contribution_amount__';
     }
     // Check for StewardshipContribution Early Binding
     $strAlias = $strAliasPrefix . 'stewardship_contribution_id__id';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     if (!is_null($objDbRow->GetColumn($strAliasName))) {
         $objToReturn->objStewardshipContribution = StewardshipContribution::InstantiateDbRow($objDbRow, $strAliasPrefix . 'stewardship_contribution_id__', $strExpandAsArrayNodes, null, $strColumnAliasArray);
     }
     // Check for StewardshipFund Early Binding
     $strAlias = $strAliasPrefix . 'stewardship_fund_id__id';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     if (!is_null($objDbRow->GetColumn($strAliasName))) {
         $objToReturn->objStewardshipFund = StewardshipFund::InstantiateDbRow($objDbRow, $strAliasPrefix . 'stewardship_fund_id__', $strExpandAsArrayNodes, null, $strColumnAliasArray);
     }
     return $objToReturn;
 }
开发者ID:alcf,项目名称:chms,代码行数:55,代码来源:StewardshipContributionAmountGen.class.php

示例5: InstantiateDbRow

 /**
  * Instantiate a Role from a Database Row.
  * Takes in an optional strAliasPrefix, used in case another Object::InstantiateDbRow
  * is calling this Role::InstantiateDbRow in order to perform
  * early binding on referenced objects.
  * @param QDatabaseRowBase $objDbRow
  * @param string $strAliasPrefix
  * @param string $strExpandAsArrayNodes
  * @param QBaseClass $objPreviousItem
  * @param string[] $strColumnAliasArray
  * @return Role
  */
 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 . 'role_id';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     if ($strExpandAsArrayNodes && $objPreviousItem && $objPreviousItem->intRoleId == $objDbRow->GetColumn($strAliasName, 'Integer')) {
         // We are.  Now, prepare to check for ExpandAsArray clauses
         $blnExpandedViaArray = false;
         if (!$strAliasPrefix) {
             $strAliasPrefix = 'role__';
         }
         $strAlias = $strAliasPrefix . 'roleentityqtypebuiltinauthorization__role_entity_built_in_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->_objRoleEntityQtypeBuiltInAuthorizationArray)) {
                 $objPreviousChildItem = $objPreviousItem->_objRoleEntityQtypeBuiltInAuthorizationArray[$intPreviousChildItemCount - 1];
                 $objChildItem = RoleEntityQtypeBuiltInAuthorization::InstantiateDbRow($objDbRow, $strAliasPrefix . 'roleentityqtypebuiltinauthorization__', $strExpandAsArrayNodes, $objPreviousChildItem, $strColumnAliasArray);
                 if ($objChildItem) {
                     $objPreviousItem->_objRoleEntityQtypeBuiltInAuthorizationArray[] = $objChildItem;
                 }
             } else {
                 $objPreviousItem->_objRoleEntityQtypeBuiltInAuthorizationArray[] = RoleEntityQtypeBuiltInAuthorization::InstantiateDbRow($objDbRow, $strAliasPrefix . 'roleentityqtypebuiltinauthorization__', $strExpandAsArrayNodes, null, $strColumnAliasArray);
             }
             $blnExpandedViaArray = true;
         }
         $strAlias = $strAliasPrefix . 'roleentityqtypecustomfieldauthorization__role_entity_qtype_custom_field_authorization_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->_objRoleEntityQtypeCustomFieldAuthorizationArray)) {
                 $objPreviousChildItem = $objPreviousItem->_objRoleEntityQtypeCustomFieldAuthorizationArray[$intPreviousChildItemCount - 1];
                 $objChildItem = RoleEntityQtypeCustomFieldAuthorization::InstantiateDbRow($objDbRow, $strAliasPrefix . 'roleentityqtypecustomfieldauthorization__', $strExpandAsArrayNodes, $objPreviousChildItem, $strColumnAliasArray);
                 if ($objChildItem) {
                     $objPreviousItem->_objRoleEntityQtypeCustomFieldAuthorizationArray[] = $objChildItem;
                 }
             } else {
                 $objPreviousItem->_objRoleEntityQtypeCustomFieldAuthorizationArray[] = RoleEntityQtypeCustomFieldAuthorization::InstantiateDbRow($objDbRow, $strAliasPrefix . 'roleentityqtypecustomfieldauthorization__', $strExpandAsArrayNodes, null, $strColumnAliasArray);
             }
             $blnExpandedViaArray = true;
         }
         $strAlias = $strAliasPrefix . 'rolemodule__role_module_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->_objRoleModuleArray)) {
                 $objPreviousChildItem = $objPreviousItem->_objRoleModuleArray[$intPreviousChildItemCount - 1];
                 $objChildItem = RoleModule::InstantiateDbRow($objDbRow, $strAliasPrefix . 'rolemodule__', $strExpandAsArrayNodes, $objPreviousChildItem, $strColumnAliasArray);
                 if ($objChildItem) {
                     $objPreviousItem->_objRoleModuleArray[] = $objChildItem;
                 }
             } else {
                 $objPreviousItem->_objRoleModuleArray[] = RoleModule::InstantiateDbRow($objDbRow, $strAliasPrefix . 'rolemodule__', $strExpandAsArrayNodes, null, $strColumnAliasArray);
             }
             $blnExpandedViaArray = true;
         }
         $strAlias = $strAliasPrefix . 'roletransactiontypeauthorization__role_transaction_type_authorization_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->_objRoleTransactionTypeAuthorizationArray)) {
                 $objPreviousChildItem = $objPreviousItem->_objRoleTransactionTypeAuthorizationArray[$intPreviousChildItemCount - 1];
                 $objChildItem = RoleTransactionTypeAuthorization::InstantiateDbRow($objDbRow, $strAliasPrefix . 'roletransactiontypeauthorization__', $strExpandAsArrayNodes, $objPreviousChildItem, $strColumnAliasArray);
                 if ($objChildItem) {
                     $objPreviousItem->_objRoleTransactionTypeAuthorizationArray[] = $objChildItem;
                 }
             } else {
                 $objPreviousItem->_objRoleTransactionTypeAuthorizationArray[] = RoleTransactionTypeAuthorization::InstantiateDbRow($objDbRow, $strAliasPrefix . 'roletransactiontypeauthorization__', $strExpandAsArrayNodes, null, $strColumnAliasArray);
             }
             $blnExpandedViaArray = true;
         }
         $strAlias = $strAliasPrefix . 'useraccount__user_account_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->_objUserAccountArray)) {
                 $objPreviousChildItem = $objPreviousItem->_objUserAccountArray[$intPreviousChildItemCount - 1];
                 $objChildItem = UserAccount::InstantiateDbRow($objDbRow, $strAliasPrefix . 'useraccount__', $strExpandAsArrayNodes, $objPreviousChildItem, $strColumnAliasArray);
                 if ($objChildItem) {
                     $objPreviousItem->_objUserAccountArray[] = $objChildItem;
                 }
             } else {
                 $objPreviousItem->_objUserAccountArray[] = UserAccount::InstantiateDbRow($objDbRow, $strAliasPrefix . 'useraccount__', $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;
//.........这里部分代码省略.........
开发者ID:proxymoron,项目名称:tracmor,代码行数:101,代码来源:RoleGen.class.php

示例6: InstantiateDbRow

 /**
  * Instantiate a EmailMessageRoute from a Database Row.
  * Takes in an optional strAliasPrefix, used in case another Object::InstantiateDbRow
  * is calling this EmailMessageRoute::InstantiateDbRow in order to perform
  * early binding on referenced objects.
  * @param QDatabaseRowBase $objDbRow
  * @param string $strAliasPrefix
  * @param string $strExpandAsArrayNodes
  * @param QBaseClass $objPreviousItem
  * @param string[] $strColumnAliasArray
  * @return EmailMessageRoute
  */
 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 EmailMessageRoute object
     $objToReturn = new EmailMessageRoute();
     $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 . 'email_message_id', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'email_message_id'] : $strAliasPrefix . 'email_message_id';
     $objToReturn->intEmailMessageId = $objDbRow->GetColumn($strAliasName, 'Integer');
     $strAliasName = array_key_exists($strAliasPrefix . 'group_id', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'group_id'] : $strAliasPrefix . 'group_id';
     $objToReturn->intGroupId = $objDbRow->GetColumn($strAliasName, 'Integer');
     $strAliasName = array_key_exists($strAliasPrefix . 'communication_list_id', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'communication_list_id'] : $strAliasPrefix . 'communication_list_id';
     $objToReturn->intCommunicationListId = $objDbRow->GetColumn($strAliasName, 'Integer');
     $strAliasName = array_key_exists($strAliasPrefix . 'login_id', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'login_id'] : $strAliasPrefix . 'login_id';
     $objToReturn->intLoginId = $objDbRow->GetColumn($strAliasName, 'Integer');
     $strAliasName = array_key_exists($strAliasPrefix . 'communication_list_entry_id', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'communication_list_entry_id'] : $strAliasPrefix . 'communication_list_entry_id';
     $objToReturn->intCommunicationListEntryId = $objDbRow->GetColumn($strAliasName, 'Integer');
     $strAliasName = array_key_exists($strAliasPrefix . 'person_id', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'person_id'] : $strAliasPrefix . 'person_id';
     $objToReturn->intPersonId = $objDbRow->GetColumn($strAliasName, '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 = 'email_message_route__';
     }
     // Check for EmailMessage Early Binding
     $strAlias = $strAliasPrefix . 'email_message_id__id';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     if (!is_null($objDbRow->GetColumn($strAliasName))) {
         $objToReturn->objEmailMessage = EmailMessage::InstantiateDbRow($objDbRow, $strAliasPrefix . 'email_message_id__', $strExpandAsArrayNodes, null, $strColumnAliasArray);
     }
     // Check for Group Early Binding
     $strAlias = $strAliasPrefix . 'group_id__id';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     if (!is_null($objDbRow->GetColumn($strAliasName))) {
         $objToReturn->objGroup = Group::InstantiateDbRow($objDbRow, $strAliasPrefix . 'group_id__', $strExpandAsArrayNodes, null, $strColumnAliasArray);
     }
     // Check for CommunicationList Early Binding
     $strAlias = $strAliasPrefix . 'communication_list_id__id';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     if (!is_null($objDbRow->GetColumn($strAliasName))) {
         $objToReturn->objCommunicationList = CommunicationList::InstantiateDbRow($objDbRow, $strAliasPrefix . 'communication_list_id__', $strExpandAsArrayNodes, null, $strColumnAliasArray);
     }
     // Check for Login Early Binding
     $strAlias = $strAliasPrefix . 'login_id__id';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     if (!is_null($objDbRow->GetColumn($strAliasName))) {
         $objToReturn->objLogin = Login::InstantiateDbRow($objDbRow, $strAliasPrefix . 'login_id__', $strExpandAsArrayNodes, null, $strColumnAliasArray);
     }
     // Check for CommunicationListEntry Early Binding
     $strAlias = $strAliasPrefix . 'communication_list_entry_id__id';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     if (!is_null($objDbRow->GetColumn($strAliasName))) {
         $objToReturn->objCommunicationListEntry = CommunicationListEntry::InstantiateDbRow($objDbRow, $strAliasPrefix . 'communication_list_entry_id__', $strExpandAsArrayNodes, null, $strColumnAliasArray);
     }
     // Check for Person Early Binding
     $strAlias = $strAliasPrefix . 'person_id__id';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     if (!is_null($objDbRow->GetColumn($strAliasName))) {
         $objToReturn->objPerson = Person::InstantiateDbRow($objDbRow, $strAliasPrefix . 'person_id__', $strExpandAsArrayNodes, null, $strColumnAliasArray);
     }
     return $objToReturn;
 }
开发者ID:alcf,项目名称:chms,代码行数:85,代码来源:EmailMessageRouteGen.class.php

示例7: InstantiateDbRow

 /**
  * Instantiate a GrowthGroupStructure from a Database Row.
  * Takes in an optional strAliasPrefix, used in case another Object::InstantiateDbRow
  * is calling this GrowthGroupStructure::InstantiateDbRow in order to perform
  * early binding on referenced objects.
  * @param QDatabaseRowBase $objDbRow
  * @param string $strAliasPrefix
  * @param string $strExpandAsArrayNodes
  * @param QBaseClass $objPreviousItem
  * @param string[] $strColumnAliasArray
  * @return GrowthGroupStructure
  */
 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 = 'growth_group_structure__';
         }
         $strAlias = $strAliasPrefix . 'groupregistrationsasgroupstructure__group_registrations_id__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->_objGroupRegistrationsAsGroupstructureArray)) {
                 $objPreviousChildItem = $objPreviousItem->_objGroupRegistrationsAsGroupstructureArray[$intPreviousChildItemCount - 1];
                 $objChildItem = GroupRegistrations::InstantiateDbRow($objDbRow, $strAliasPrefix . 'groupregistrationsasgroupstructure__group_registrations_id__', $strExpandAsArrayNodes, $objPreviousChildItem, $strColumnAliasArray);
                 if ($objChildItem) {
                     $objPreviousItem->_objGroupRegistrationsAsGroupstructureArray[] = $objChildItem;
                 }
             } else {
                 $objPreviousItem->_objGroupRegistrationsAsGroupstructureArray[] = GroupRegistrations::InstantiateDbRow($objDbRow, $strAliasPrefix . 'groupregistrationsasgroupstructure__group_registrations_id__', $strExpandAsArrayNodes, null, $strColumnAliasArray);
             }
             $blnExpandedViaArray = true;
         }
         $strAlias = $strAliasPrefix . 'growthgroup__growth_group_id__group_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->_objGrowthGroupArray)) {
                 $objPreviousChildItem = $objPreviousItem->_objGrowthGroupArray[$intPreviousChildItemCount - 1];
                 $objChildItem = GrowthGroup::InstantiateDbRow($objDbRow, $strAliasPrefix . 'growthgroup__growth_group_id__', $strExpandAsArrayNodes, $objPreviousChildItem, $strColumnAliasArray);
                 if ($objChildItem) {
                     $objPreviousItem->_objGrowthGroupArray[] = $objChildItem;
                 }
             } else {
                 $objPreviousItem->_objGrowthGroupArray[] = GrowthGroup::InstantiateDbRow($objDbRow, $strAliasPrefix . 'growthgroup__growth_group_id__', $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 == 'growth_group_structure__') {
                 $strAliasPrefix = null;
             }
         }
     }
     // Create a new instance of the GrowthGroupStructure object
     $objToReturn = new GrowthGroupStructure();
     $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 = 'growth_group_structure__';
     }
     // Check for GroupRegistrationsAsGroupstructure Virtual Binding
     $strAlias = $strAliasPrefix . 'groupregistrationsasgroupstructure__group_registrations_id__id';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     if (!is_null($objDbRow->GetColumn($strAliasName))) {
         if ($strExpandAsArrayNodes && array_key_exists($strAlias, $strExpandAsArrayNodes)) {
             $objToReturn->_objGroupRegistrationsAsGroupstructureArray[] = GroupRegistrations::InstantiateDbRow($objDbRow, $strAliasPrefix . 'groupregistrationsasgroupstructure__group_registrations_id__', $strExpandAsArrayNodes, null, $strColumnAliasArray);
         } else {
             $objToReturn->_objGroupRegistrationsAsGroupstructure = GroupRegistrations::InstantiateDbRow($objDbRow, $strAliasPrefix . 'groupregistrationsasgroupstructure__group_registrations_id__', $strExpandAsArrayNodes, null, $strColumnAliasArray);
         }
     }
     // Check for GrowthGroup Virtual Binding
     $strAlias = $strAliasPrefix . 'growthgroup__growth_group_id__group_id';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     if (!is_null($objDbRow->GetColumn($strAliasName))) {
         if ($strExpandAsArrayNodes && array_key_exists($strAlias, $strExpandAsArrayNodes)) {
             $objToReturn->_objGrowthGroupArray[] = GrowthGroup::InstantiateDbRow($objDbRow, $strAliasPrefix . 'growthgroup__growth_group_id__', $strExpandAsArrayNodes, null, $strColumnAliasArray);
         } else {
//.........这里部分代码省略.........
开发者ID:alcf,项目名称:chms,代码行数:101,代码来源:GrowthGroupStructureGen.class.php

示例8: InstantiateDbRow

 /**
  * Instantiate a StewardshipPost from a Database Row.
  * Takes in an optional strAliasPrefix, used in case another Object::InstantiateDbRow
  * is calling this StewardshipPost::InstantiateDbRow in order to perform
  * early binding on referenced objects.
  * @param QDatabaseRowBase $objDbRow
  * @param string $strAliasPrefix
  * @param string $strExpandAsArrayNodes
  * @param QBaseClass $objPreviousItem
  * @param string[] $strColumnAliasArray
  * @return StewardshipPost
  */
 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 = 'stewardship_post__';
         }
         $strAlias = $strAliasPrefix . 'stewardshippostamount__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->_objStewardshipPostAmountArray)) {
                 $objPreviousChildItem = $objPreviousItem->_objStewardshipPostAmountArray[$intPreviousChildItemCount - 1];
                 $objChildItem = StewardshipPostAmount::InstantiateDbRow($objDbRow, $strAliasPrefix . 'stewardshippostamount__', $strExpandAsArrayNodes, $objPreviousChildItem, $strColumnAliasArray);
                 if ($objChildItem) {
                     $objPreviousItem->_objStewardshipPostAmountArray[] = $objChildItem;
                 }
             } else {
                 $objPreviousItem->_objStewardshipPostAmountArray[] = StewardshipPostAmount::InstantiateDbRow($objDbRow, $strAliasPrefix . 'stewardshippostamount__', $strExpandAsArrayNodes, null, $strColumnAliasArray);
             }
             $blnExpandedViaArray = true;
         }
         $strAlias = $strAliasPrefix . 'stewardshippostlineitem__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->_objStewardshipPostLineItemArray)) {
                 $objPreviousChildItem = $objPreviousItem->_objStewardshipPostLineItemArray[$intPreviousChildItemCount - 1];
                 $objChildItem = StewardshipPostLineItem::InstantiateDbRow($objDbRow, $strAliasPrefix . 'stewardshippostlineitem__', $strExpandAsArrayNodes, $objPreviousChildItem, $strColumnAliasArray);
                 if ($objChildItem) {
                     $objPreviousItem->_objStewardshipPostLineItemArray[] = $objChildItem;
                 }
             } else {
                 $objPreviousItem->_objStewardshipPostLineItemArray[] = StewardshipPostLineItem::InstantiateDbRow($objDbRow, $strAliasPrefix . 'stewardshippostlineitem__', $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 == 'stewardship_post__') {
                 $strAliasPrefix = null;
             }
         }
     }
     // Create a new instance of the StewardshipPost object
     $objToReturn = new StewardshipPost();
     $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 . 'stewardship_batch_id', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'stewardship_batch_id'] : $strAliasPrefix . 'stewardship_batch_id';
     $objToReturn->intStewardshipBatchId = $objDbRow->GetColumn($strAliasName, 'Integer');
     $strAliasName = array_key_exists($strAliasPrefix . 'post_number', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'post_number'] : $strAliasPrefix . 'post_number';
     $objToReturn->intPostNumber = $objDbRow->GetColumn($strAliasName, 'Integer');
     $strAliasName = array_key_exists($strAliasPrefix . 'date_posted', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'date_posted'] : $strAliasPrefix . 'date_posted';
     $objToReturn->dttDatePosted = $objDbRow->GetColumn($strAliasName, 'DateTime');
     $strAliasName = array_key_exists($strAliasPrefix . 'total_amount', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'total_amount'] : $strAliasPrefix . 'total_amount';
     $objToReturn->fltTotalAmount = $objDbRow->GetColumn($strAliasName, 'Float');
     $strAliasName = array_key_exists($strAliasPrefix . 'created_by_login_id', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'created_by_login_id'] : $strAliasPrefix . 'created_by_login_id';
     $objToReturn->intCreatedByLoginId = $objDbRow->GetColumn($strAliasName, '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 = 'stewardship_post__';
     }
     // Check for StewardshipBatch Early Binding
     $strAlias = $strAliasPrefix . 'stewardship_batch_id__id';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     if (!is_null($objDbRow->GetColumn($strAliasName))) {
         $objToReturn->objStewardshipBatch = StewardshipBatch::InstantiateDbRow($objDbRow, $strAliasPrefix . 'stewardship_batch_id__', $strExpandAsArrayNodes, null, $strColumnAliasArray);
     }
     // Check for CreatedByLogin Early Binding
     $strAlias = $strAliasPrefix . 'created_by_login_id__id';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
//.........这里部分代码省略.........
开发者ID:alcf,项目名称:chms,代码行数:101,代码来源:StewardshipPostGen.class.php

示例9: InstantiateDbRow

 /**
  * Instantiate a HouseholdParticipation from a Database Row.
  * Takes in an optional strAliasPrefix, used in case another Object::InstantiateDbRow
  * is calling this HouseholdParticipation::InstantiateDbRow in order to perform
  * early binding on referenced objects.
  * @param QDatabaseRowBase $objDbRow
  * @param string $strAliasPrefix
  * @param string $strExpandAsArrayNodes
  * @param QBaseClass $objPreviousItem
  * @param string[] $strColumnAliasArray
  * @return HouseholdParticipation
  */
 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 HouseholdParticipation object
     $objToReturn = new HouseholdParticipation();
     $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 . 'person_id', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'person_id'] : $strAliasPrefix . 'person_id';
     $objToReturn->intPersonId = $objDbRow->GetColumn($strAliasName, 'Integer');
     $strAliasName = array_key_exists($strAliasPrefix . 'household_id', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'household_id'] : $strAliasPrefix . 'household_id';
     $objToReturn->intHouseholdId = $objDbRow->GetColumn($strAliasName, 'Integer');
     $strAliasName = array_key_exists($strAliasPrefix . 'role', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'role'] : $strAliasPrefix . 'role';
     $objToReturn->strRole = $objDbRow->GetColumn($strAliasName, 'VarChar');
     $strAliasName = array_key_exists($strAliasPrefix . 'role_override', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'role_override'] : $strAliasPrefix . 'role_override';
     $objToReturn->strRoleOverride = $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 = 'household_participation__';
     }
     // Check for Person Early Binding
     $strAlias = $strAliasPrefix . 'person_id__id';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     if (!is_null($objDbRow->GetColumn($strAliasName))) {
         $objToReturn->objPerson = Person::InstantiateDbRow($objDbRow, $strAliasPrefix . 'person_id__', $strExpandAsArrayNodes, null, $strColumnAliasArray);
     }
     // Check for Household Early Binding
     $strAlias = $strAliasPrefix . 'household_id__id';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     if (!is_null($objDbRow->GetColumn($strAliasName))) {
         $objToReturn->objHousehold = Household::InstantiateDbRow($objDbRow, $strAliasPrefix . 'household_id__', $strExpandAsArrayNodes, null, $strColumnAliasArray);
     }
     return $objToReturn;
 }
开发者ID:alcf,项目名称:chms,代码行数:57,代码来源:HouseholdParticipationGen.class.php

示例10: InstantiateDbRow

 /**
  * Instantiate a FormAnswer from a Database Row.
  * Takes in an optional strAliasPrefix, used in case another Object::InstantiateDbRow
  * is calling this FormAnswer::InstantiateDbRow in order to perform
  * early binding on referenced objects.
  * @param QDatabaseRowBase $objDbRow
  * @param string $strAliasPrefix
  * @param string $strExpandAsArrayNodes
  * @param QBaseClass $objPreviousItem
  * @param string[] $strColumnAliasArray
  * @return FormAnswer
  */
 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 FormAnswer object
     $objToReturn = new FormAnswer();
     $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 . 'signup_entry_id', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'signup_entry_id'] : $strAliasPrefix . 'signup_entry_id';
     $objToReturn->intSignupEntryId = $objDbRow->GetColumn($strAliasName, 'Integer');
     $strAliasName = array_key_exists($strAliasPrefix . 'form_question_id', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'form_question_id'] : $strAliasPrefix . 'form_question_id';
     $objToReturn->intFormQuestionId = $objDbRow->GetColumn($strAliasName, 'Integer');
     $strAliasName = array_key_exists($strAliasPrefix . 'text_value', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'text_value'] : $strAliasPrefix . 'text_value';
     $objToReturn->strTextValue = $objDbRow->GetColumn($strAliasName, 'Blob');
     $strAliasName = array_key_exists($strAliasPrefix . 'address_id', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'address_id'] : $strAliasPrefix . 'address_id';
     $objToReturn->intAddressId = $objDbRow->GetColumn($strAliasName, 'Integer');
     $strAliasName = array_key_exists($strAliasPrefix . 'phone_id', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'phone_id'] : $strAliasPrefix . 'phone_id';
     $objToReturn->intPhoneId = $objDbRow->GetColumn($strAliasName, 'Integer');
     $strAliasName = array_key_exists($strAliasPrefix . 'email_id', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'email_id'] : $strAliasPrefix . 'email_id';
     $objToReturn->intEmailId = $objDbRow->GetColumn($strAliasName, 'Integer');
     $strAliasName = array_key_exists($strAliasPrefix . 'integer_value', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'integer_value'] : $strAliasPrefix . 'integer_value';
     $objToReturn->intIntegerValue = $objDbRow->GetColumn($strAliasName, 'Integer');
     $strAliasName = array_key_exists($strAliasPrefix . 'boolean_value', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'boolean_value'] : $strAliasPrefix . 'boolean_value';
     $objToReturn->blnBooleanValue = $objDbRow->GetColumn($strAliasName, 'Bit');
     $strAliasName = array_key_exists($strAliasPrefix . 'date_value', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'date_value'] : $strAliasPrefix . 'date_value';
     $objToReturn->dttDateValue = $objDbRow->GetColumn($strAliasName, 'Date');
     // 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 = 'form_answer__';
     }
     // Check for SignupEntry Early Binding
     $strAlias = $strAliasPrefix . 'signup_entry_id__id';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     if (!is_null($objDbRow->GetColumn($strAliasName))) {
         $objToReturn->objSignupEntry = SignupEntry::InstantiateDbRow($objDbRow, $strAliasPrefix . 'signup_entry_id__', $strExpandAsArrayNodes, null, $strColumnAliasArray);
     }
     // Check for FormQuestion Early Binding
     $strAlias = $strAliasPrefix . 'form_question_id__id';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     if (!is_null($objDbRow->GetColumn($strAliasName))) {
         $objToReturn->objFormQuestion = FormQuestion::InstantiateDbRow($objDbRow, $strAliasPrefix . 'form_question_id__', $strExpandAsArrayNodes, null, $strColumnAliasArray);
     }
     // Check for Address Early Binding
     $strAlias = $strAliasPrefix . 'address_id__id';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     if (!is_null($objDbRow->GetColumn($strAliasName))) {
         $objToReturn->objAddress = Address::InstantiateDbRow($objDbRow, $strAliasPrefix . 'address_id__', $strExpandAsArrayNodes, null, $strColumnAliasArray);
     }
     // Check for Phone Early Binding
     $strAlias = $strAliasPrefix . 'phone_id__id';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     if (!is_null($objDbRow->GetColumn($strAliasName))) {
         $objToReturn->objPhone = Phone::InstantiateDbRow($objDbRow, $strAliasPrefix . 'phone_id__', $strExpandAsArrayNodes, null, $strColumnAliasArray);
     }
     // Check for Email Early Binding
     $strAlias = $strAliasPrefix . 'email_id__id';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     if (!is_null($objDbRow->GetColumn($strAliasName))) {
         $objToReturn->objEmail = Email::InstantiateDbRow($objDbRow, $strAliasPrefix . 'email_id__', $strExpandAsArrayNodes, null, $strColumnAliasArray);
     }
     return $objToReturn;
 }
开发者ID:alcf,项目名称:chms,代码行数:85,代码来源:FormAnswerGen.class.php

示例11: InstantiateDbRow

 /**
  * Instantiate a Registry from a Database Row.
  * Takes in an optional strAliasPrefix, used in case another Object::InstantiateDbRow
  * is calling this Registry::InstantiateDbRow in order to perform
  * early binding on referenced objects.
  * @param QDatabaseRowBase $objDbRow
  * @param string $strAliasPrefix
  * @param string $strExpandAsArrayNodes
  * @param QBaseClass $objPreviousItem
  * @param string[] $strColumnAliasArray
  * @return Registry
  */
 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 Registry object
     $objToReturn = new Registry();
     $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');
     $strAliasName = array_key_exists($strAliasPrefix . 'value', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'value'] : $strAliasPrefix . 'value';
     $objToReturn->strValue = $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 = 'registry__';
     }
     return $objToReturn;
 }
开发者ID:qcodo,项目名称:qcodo-website,代码行数:41,代码来源:RegistryGen.class.php

示例12: InstantiateDbRow

 /**
  * Instantiate a Company from a Database Row.
  * Takes in an optional strAliasPrefix, used in case another Object::InstantiateDbRow
  * is calling this Company::InstantiateDbRow in order to perform
  * early binding on referenced objects.
  * @param QDatabaseRowBase $objDbRow
  * @param string $strAliasPrefix
  * @param string $strExpandAsArrayNodes
  * @param QBaseClass $objPreviousItem
  * @param string[] $strColumnAliasArray
  * @return Company
  */
 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 . 'company_id';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     if ($strExpandAsArrayNodes && $objPreviousItem && $objPreviousItem->intCompanyId == $objDbRow->GetColumn($strAliasName, 'Integer')) {
         // We are.  Now, prepare to check for ExpandAsArray clauses
         $blnExpandedViaArray = false;
         if (!$strAliasPrefix) {
             $strAliasPrefix = 'company__';
         }
         $strAlias = $strAliasPrefix . 'address__address_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->_objAddressArray)) {
                 $objPreviousChildItem = $objPreviousItem->_objAddressArray[$intPreviousChildItemCount - 1];
                 $objChildItem = Address::InstantiateDbRow($objDbRow, $strAliasPrefix . 'address__', $strExpandAsArrayNodes, $objPreviousChildItem, $strColumnAliasArray);
                 if ($objChildItem) {
                     $objPreviousItem->_objAddressArray[] = $objChildItem;
                 }
             } else {
                 $objPreviousItem->_objAddressArray[] = Address::InstantiateDbRow($objDbRow, $strAliasPrefix . 'address__', $strExpandAsArrayNodes, null, $strColumnAliasArray);
             }
             $blnExpandedViaArray = true;
         }
         $strAlias = $strAliasPrefix . 'contact__contact_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->_objContactArray)) {
                 $objPreviousChildItem = $objPreviousItem->_objContactArray[$intPreviousChildItemCount - 1];
                 $objChildItem = Contact::InstantiateDbRow($objDbRow, $strAliasPrefix . 'contact__', $strExpandAsArrayNodes, $objPreviousChildItem, $strColumnAliasArray);
                 if ($objChildItem) {
                     $objPreviousItem->_objContactArray[] = $objChildItem;
                 }
             } else {
                 $objPreviousItem->_objContactArray[] = Contact::InstantiateDbRow($objDbRow, $strAliasPrefix . 'contact__', $strExpandAsArrayNodes, null, $strColumnAliasArray);
             }
             $blnExpandedViaArray = true;
         }
         $strAlias = $strAliasPrefix . 'receiptasfrom__receipt_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->_objReceiptAsFromArray)) {
                 $objPreviousChildItem = $objPreviousItem->_objReceiptAsFromArray[$intPreviousChildItemCount - 1];
                 $objChildItem = Receipt::InstantiateDbRow($objDbRow, $strAliasPrefix . 'receiptasfrom__', $strExpandAsArrayNodes, $objPreviousChildItem, $strColumnAliasArray);
                 if ($objChildItem) {
                     $objPreviousItem->_objReceiptAsFromArray[] = $objChildItem;
                 }
             } else {
                 $objPreviousItem->_objReceiptAsFromArray[] = Receipt::InstantiateDbRow($objDbRow, $strAliasPrefix . 'receiptasfrom__', $strExpandAsArrayNodes, null, $strColumnAliasArray);
             }
             $blnExpandedViaArray = true;
         }
         $strAlias = $strAliasPrefix . 'shipmentasfrom__shipment_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->_objShipmentAsFromArray)) {
                 $objPreviousChildItem = $objPreviousItem->_objShipmentAsFromArray[$intPreviousChildItemCount - 1];
                 $objChildItem = Shipment::InstantiateDbRow($objDbRow, $strAliasPrefix . 'shipmentasfrom__', $strExpandAsArrayNodes, $objPreviousChildItem, $strColumnAliasArray);
                 if ($objChildItem) {
                     $objPreviousItem->_objShipmentAsFromArray[] = $objChildItem;
                 }
             } else {
                 $objPreviousItem->_objShipmentAsFromArray[] = Shipment::InstantiateDbRow($objDbRow, $strAliasPrefix . 'shipmentasfrom__', $strExpandAsArrayNodes, null, $strColumnAliasArray);
             }
             $blnExpandedViaArray = true;
         }
         $strAlias = $strAliasPrefix . 'shipmentasto__shipment_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->_objShipmentAsToArray)) {
                 $objPreviousChildItem = $objPreviousItem->_objShipmentAsToArray[$intPreviousChildItemCount - 1];
                 $objChildItem = Shipment::InstantiateDbRow($objDbRow, $strAliasPrefix . 'shipmentasto__', $strExpandAsArrayNodes, $objPreviousChildItem, $strColumnAliasArray);
                 if ($objChildItem) {
                     $objPreviousItem->_objShipmentAsToArray[] = $objChildItem;
                 }
             } else {
                 $objPreviousItem->_objShipmentAsToArray[] = Shipment::InstantiateDbRow($objDbRow, $strAliasPrefix . 'shipmentasto__', $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;
//.........这里部分代码省略.........
开发者ID:proxymoron,项目名称:tracmor,代码行数:101,代码来源:CompanyGen.class.php

示例13: InstantiateDbRow

 /**
  * Instantiate a GrowthGroup from a Database Row.
  * Takes in an optional strAliasPrefix, used in case another Object::InstantiateDbRow
  * is calling this GrowthGroup::InstantiateDbRow in order to perform
  * early binding on referenced objects.
  * @param QDatabaseRowBase $objDbRow
  * @param string $strAliasPrefix
  * @param string $strExpandAsArrayNodes
  * @param QBaseClass $objPreviousItem
  * @param string[] $strColumnAliasArray
  * @return GrowthGroup
  */
 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 . 'group_id';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     if ($strExpandAsArrayNodes && $objPreviousItem && $objPreviousItem->intGroupId == $objDbRow->GetColumn($strAliasName, 'Integer')) {
         // We are.  Now, prepare to check for ExpandAsArray clauses
         $blnExpandedViaArray = false;
         if (!$strAliasPrefix) {
             $strAliasPrefix = 'growth_group__';
         }
         $strAlias = $strAliasPrefix . 'growthgroupstructure__growth_group_structure_id__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->_objGrowthGroupStructureArray)) {
                 $objPreviousChildItem = $objPreviousItem->_objGrowthGroupStructureArray[$intPreviousChildItemCount - 1];
                 $objChildItem = GrowthGroupStructure::InstantiateDbRow($objDbRow, $strAliasPrefix . 'growthgroupstructure__growth_group_structure_id__', $strExpandAsArrayNodes, $objPreviousChildItem, $strColumnAliasArray);
                 if ($objChildItem) {
                     $objPreviousItem->_objGrowthGroupStructureArray[] = $objChildItem;
                 }
             } else {
                 $objPreviousItem->_objGrowthGroupStructureArray[] = GrowthGroupStructure::InstantiateDbRow($objDbRow, $strAliasPrefix . 'growthgroupstructure__growth_group_structure_id__', $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 == 'growth_group__') {
                 $strAliasPrefix = null;
             }
         }
     }
     // Create a new instance of the GrowthGroup object
     $objToReturn = new GrowthGroup();
     $objToReturn->__blnRestored = true;
     $strAliasName = array_key_exists($strAliasPrefix . 'group_id', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'group_id'] : $strAliasPrefix . 'group_id';
     $objToReturn->intGroupId = $objDbRow->GetColumn($strAliasName, 'Integer');
     $objToReturn->__intGroupId = $objDbRow->GetColumn($strAliasName, 'Integer');
     $strAliasName = array_key_exists($strAliasPrefix . 'growth_group_location_id', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'growth_group_location_id'] : $strAliasPrefix . 'growth_group_location_id';
     $objToReturn->intGrowthGroupLocationId = $objDbRow->GetColumn($strAliasName, 'Integer');
     $strAliasName = array_key_exists($strAliasPrefix . 'growth_group_day_type_id', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'growth_group_day_type_id'] : $strAliasPrefix . 'growth_group_day_type_id';
     $objToReturn->intGrowthGroupDayTypeId = $objDbRow->GetColumn($strAliasName, 'Integer');
     $strAliasName = array_key_exists($strAliasPrefix . 'meeting_bitmap', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'meeting_bitmap'] : $strAliasPrefix . 'meeting_bitmap';
     $objToReturn->intMeetingBitmap = $objDbRow->GetColumn($strAliasName, 'Integer');
     $strAliasName = array_key_exists($strAliasPrefix . 'start_time', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'start_time'] : $strAliasPrefix . 'start_time';
     $objToReturn->intStartTime = $objDbRow->GetColumn($strAliasName, 'Integer');
     $strAliasName = array_key_exists($strAliasPrefix . 'end_time', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'end_time'] : $strAliasPrefix . 'end_time';
     $objToReturn->intEndTime = $objDbRow->GetColumn($strAliasName, 'Integer');
     $strAliasName = array_key_exists($strAliasPrefix . 'address_1', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'address_1'] : $strAliasPrefix . 'address_1';
     $objToReturn->strAddress1 = $objDbRow->GetColumn($strAliasName, 'VarChar');
     $strAliasName = array_key_exists($strAliasPrefix . 'address_2', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'address_2'] : $strAliasPrefix . 'address_2';
     $objToReturn->strAddress2 = $objDbRow->GetColumn($strAliasName, 'VarChar');
     $strAliasName = array_key_exists($strAliasPrefix . 'cross_street_1', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'cross_street_1'] : $strAliasPrefix . 'cross_street_1';
     $objToReturn->strCrossStreet1 = $objDbRow->GetColumn($strAliasName, 'VarChar');
     $strAliasName = array_key_exists($strAliasPrefix . 'cross_street_2', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'cross_street_2'] : $strAliasPrefix . 'cross_street_2';
     $objToReturn->strCrossStreet2 = $objDbRow->GetColumn($strAliasName, 'VarChar');
     $strAliasName = array_key_exists($strAliasPrefix . 'zip_code', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'zip_code'] : $strAliasPrefix . 'zip_code';
     $objToReturn->strZipCode = $objDbRow->GetColumn($strAliasName, 'VarChar');
     $strAliasName = array_key_exists($strAliasPrefix . 'longitude', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'longitude'] : $strAliasPrefix . 'longitude';
     $objToReturn->fltLongitude = $objDbRow->GetColumn($strAliasName, 'Float');
     $strAliasName = array_key_exists($strAliasPrefix . 'latitude', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'latitude'] : $strAliasPrefix . 'latitude';
     $objToReturn->fltLatitude = $objDbRow->GetColumn($strAliasName, 'Float');
     $strAliasName = array_key_exists($strAliasPrefix . 'accuracy', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'accuracy'] : $strAliasPrefix . 'accuracy';
     $objToReturn->intAccuracy = $objDbRow->GetColumn($strAliasName, 'Integer');
     $strAliasName = array_key_exists($strAliasPrefix . 'description', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'description'] : $strAliasPrefix . 'description';
     $objToReturn->strDescription = $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 = 'growth_group__';
     }
     // Check for Group Early Binding
     $strAlias = $strAliasPrefix . 'group_id__id';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     if (!is_null($objDbRow->GetColumn($strAliasName))) {
//.........这里部分代码省略.........
开发者ID:alcf,项目名称:chms,代码行数:101,代码来源:GrowthGroupGen.class.php

示例14: InstantiateDbRow

 /**
  * Instantiate a Datagrid from a Database Row.
  * Takes in an optional strAliasPrefix, used in case another Object::InstantiateDbRow
  * is calling this Datagrid::InstantiateDbRow in order to perform
  * early binding on referenced objects.
  * @param QDatabaseRowBase $objDbRow
  * @param string $strAliasPrefix
  * @param string $strExpandAsArrayNodes
  * @param QBaseClass $objPreviousItem
  * @param string[] $strColumnAliasArray
  * @return Datagrid
  */
 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 . 'datagrid_id';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     if ($strExpandAsArrayNodes && $objPreviousItem && $objPreviousItem->intDatagridId == $objDbRow->GetColumn($strAliasName, 'Integer')) {
         // We are.  Now, prepare to check for ExpandAsArray clauses
         $blnExpandedViaArray = false;
         if (!$strAliasPrefix) {
             $strAliasPrefix = 'datagrid__';
         }
         $strAlias = $strAliasPrefix . 'datagridcolumnpreference__datagrid_column_preference_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->_objDatagridColumnPreferenceArray)) {
                 $objPreviousChildItem = $objPreviousItem->_objDatagridColumnPreferenceArray[$intPreviousChildItemCount - 1];
                 $objChildItem = DatagridColumnPreference::InstantiateDbRow($objDbRow, $strAliasPrefix . 'datagridcolumnpreference__', $strExpandAsArrayNodes, $objPreviousChildItem, $strColumnAliasArray);
                 if ($objChildItem) {
                     $objPreviousItem->_objDatagridColumnPreferenceArray[] = $objChildItem;
                 }
             } else {
                 $objPreviousItem->_objDatagridColumnPreferenceArray[] = DatagridColumnPreference::InstantiateDbRow($objDbRow, $strAliasPrefix . 'datagridcolumnpreference__', $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 == 'datagrid__') {
                 $strAliasPrefix = null;
             }
         }
     }
     // Create a new instance of the Datagrid object
     $objToReturn = new Datagrid();
     $objToReturn->__blnRestored = true;
     $strAliasName = array_key_exists($strAliasPrefix . 'datagrid_id', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'datagrid_id'] : $strAliasPrefix . 'datagrid_id';
     $objToReturn->intDatagridId = $objDbRow->GetColumn($strAliasName, 'Integer');
     $strAliasName = array_key_exists($strAliasPrefix . 'short_description', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'short_description'] : $strAliasPrefix . 'short_description';
     $objToReturn->strShortDescription = $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 = 'datagrid__';
     }
     // Check for DatagridColumnPreference Virtual Binding
     $strAlias = $strAliasPrefix . 'datagridcolumnpreference__datagrid_column_preference_id';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     if (!is_null($objDbRow->GetColumn($strAliasName))) {
         if ($strExpandAsArrayNodes && array_key_exists($strAlias, $strExpandAsArrayNodes)) {
             $objToReturn->_objDatagridColumnPreferenceArray[] = DatagridColumnPreference::InstantiateDbRow($objDbRow, $strAliasPrefix . 'datagridcolumnpreference__', $strExpandAsArrayNodes, null, $strColumnAliasArray);
         } else {
             $objToReturn->_objDatagridColumnPreference = DatagridColumnPreference::InstantiateDbRow($objDbRow, $strAliasPrefix . 'datagridcolumnpreference__', $strExpandAsArrayNodes, null, $strColumnAliasArray);
         }
     }
     return $objToReturn;
 }
开发者ID:proxymoron,项目名称:tracmor,代码行数:81,代码来源:DatagridGen.class.php

示例15: InstantiateDbRow

 /**
  * Instantiate a ClassifiedCategory from a Database Row.
  * Takes in an optional strAliasPrefix, used in case another Object::InstantiateDbRow
  * is calling this ClassifiedCategory::InstantiateDbRow in order to perform
  * early binding on referenced objects.
  * @param QDatabaseRowBase $objDbRow
  * @param string $strAliasPrefix
  * @param string $strExpandAsArrayNodes
  * @param QBaseClass $objPreviousItem
  * @param string[] $strColumnAliasArray
  * @return ClassifiedCategory
  */
 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 = 'classified_category__';
         }
         $strAlias = $strAliasPrefix . 'classifiedpost__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->_objClassifiedPostArray)) {
                 $objPreviousChildItem = $objPreviousItem->_objClassifiedPostArray[$intPreviousChildItemCount - 1];
                 $objChildItem = ClassifiedPost::InstantiateDbRow($objDbRow, $strAliasPrefix . 'classifiedpost__', $strExpandAsArrayNodes, $objPreviousChildItem, $strColumnAliasArray);
                 if ($objChildItem) {
                     $objPreviousItem->_objClassifiedPostArray[] = $objChildItem;
                 }
             } else {
                 $objPreviousItem->_objClassifiedPostArray[] = ClassifiedPost::InstantiateDbRow($objDbRow, $strAliasPrefix . 'classifiedpost__', $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 == 'classified_category__') {
                 $strAliasPrefix = null;
             }
         }
     }
     // Create a new instance of the ClassifiedCategory object
     $objToReturn = new ClassifiedCategory();
     $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');
     $strAliasName = array_key_exists($strAliasPrefix . 'token', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'token'] : $strAliasPrefix . 'token';
     $objToReturn->strToken = $objDbRow->GetColumn($strAliasName, 'VarChar');
     $strAliasName = array_key_exists($strAliasPrefix . 'order_number', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'order_number'] : $strAliasPrefix . 'order_number';
     $objToReturn->intOrderNumber = $objDbRow->GetColumn($strAliasName, 'Integer');
     $strAliasName = array_key_exists($strAliasPrefix . 'description', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'description'] : $strAliasPrefix . 'description';
     $objToReturn->strDescription = $objDbRow->GetColumn($strAliasName, 'Blob');
     $strAliasName = array_key_exists($strAliasPrefix . 'instructions', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'instructions'] : $strAliasPrefix . 'instructions';
     $objToReturn->strInstructions = $objDbRow->GetColumn($strAliasName, 'Blob');
     $strAliasName = array_key_exists($strAliasPrefix . 'disclaimer', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'disclaimer'] : $strAliasPrefix . 'disclaimer';
     $objToReturn->strDisclaimer = $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 = 'classified_category__';
     }
     // Check for ClassifiedPost Virtual Binding
     $strAlias = $strAliasPrefix . 'classifiedpost__id';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     if (!is_null($objDbRow->GetColumn($strAliasName))) {
         if ($strExpandAsArrayNodes && array_key_exists($strAlias, $strExpandAsArrayNodes)) {
             $objToReturn->_objClassifiedPostArray[] = ClassifiedPost::InstantiateDbRow($objDbRow, $strAliasPrefix . 'classifiedpost__', $strExpandAsArrayNodes, null, $strColumnAliasArray);
         } else {
             $objToReturn->_objClassifiedPost = ClassifiedPost::InstantiateDbRow($objDbRow, $strAliasPrefix . 'classifiedpost__', $strExpandAsArrayNodes, null, $strColumnAliasArray);
         }
     }
     return $objToReturn;
 }
开发者ID:alcf,项目名称:chms,代码行数:91,代码来源:ClassifiedCategoryGen.class.php


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