示例#1
0
 /**
  * Instantiate a single StewardshipStack object from a query cursor (e.g. a DB ResultSet).
  * Cursor is automatically moved to the "next row" of the result set.
  * Will return NULL if no cursor or if the cursor has no more rows in the resultset.
  * @param QDatabaseResultBase $objDbResult cursor resource
  * @return StewardshipStack next row resulting from the query
  */
 public static function InstantiateCursor(QDatabaseResultBase $objDbResult)
 {
     // If blank resultset, then return empty result
     if (!$objDbResult) {
         return null;
     }
     // If empty resultset, then return empty result
     $objDbRow = $objDbResult->GetNextRow();
     if (!$objDbRow) {
         return null;
     }
     // We need the Column Aliases
     $strColumnAliasArray = $objDbResult->QueryBuilder->ColumnAliasArray;
     if (!$strColumnAliasArray) {
         $strColumnAliasArray = array();
     }
     // Pull Expansions (if applicable)
     $strExpandAsArrayNodes = $objDbResult->QueryBuilder->ExpandAsArrayNodes;
     // Load up the return result with a row and return it
     return StewardshipStack::InstantiateDbRow($objDbRow, null, $strExpandAsArrayNodes, null, $strColumnAliasArray);
 }
示例#2
0
 /**
  * Instantiate a StewardshipBatch from a Database Row.
  * Takes in an optional strAliasPrefix, used in case another Object::InstantiateDbRow
  * is calling this StewardshipBatch::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 StewardshipBatch
  */
 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_batch__';
         }
         $strAlias = $strAliasPrefix . 'stewardshipcontribution__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->_objStewardshipContributionArray)) {
                 $objPreviousChildItem = $objPreviousItem->_objStewardshipContributionArray[$intPreviousChildItemCount - 1];
                 $objChildItem = StewardshipContribution::InstantiateDbRow($objDbRow, $strAliasPrefix . 'stewardshipcontribution__', $strExpandAsArrayNodes, $objPreviousChildItem, $strColumnAliasArray);
                 if ($objChildItem) {
                     $objPreviousItem->_objStewardshipContributionArray[] = $objChildItem;
                 }
             } else {
                 $objPreviousItem->_objStewardshipContributionArray[] = StewardshipContribution::InstantiateDbRow($objDbRow, $strAliasPrefix . 'stewardshipcontribution__', $strExpandAsArrayNodes, null, $strColumnAliasArray);
             }
             $blnExpandedViaArray = true;
         }
         $strAlias = $strAliasPrefix . 'stewardshippost__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->_objStewardshipPostArray)) {
                 $objPreviousChildItem = $objPreviousItem->_objStewardshipPostArray[$intPreviousChildItemCount - 1];
                 $objChildItem = StewardshipPost::InstantiateDbRow($objDbRow, $strAliasPrefix . 'stewardshippost__', $strExpandAsArrayNodes, $objPreviousChildItem, $strColumnAliasArray);
                 if ($objChildItem) {
                     $objPreviousItem->_objStewardshipPostArray[] = $objChildItem;
                 }
             } else {
                 $objPreviousItem->_objStewardshipPostArray[] = StewardshipPost::InstantiateDbRow($objDbRow, $strAliasPrefix . 'stewardshippost__', $strExpandAsArrayNodes, null, $strColumnAliasArray);
             }
             $blnExpandedViaArray = true;
         }
         $strAlias = $strAliasPrefix . 'stewardshipstack__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->_objStewardshipStackArray)) {
                 $objPreviousChildItem = $objPreviousItem->_objStewardshipStackArray[$intPreviousChildItemCount - 1];
                 $objChildItem = StewardshipStack::InstantiateDbRow($objDbRow, $strAliasPrefix . 'stewardshipstack__', $strExpandAsArrayNodes, $objPreviousChildItem, $strColumnAliasArray);
                 if ($objChildItem) {
                     $objPreviousItem->_objStewardshipStackArray[] = $objChildItem;
                 }
             } else {
                 $objPreviousItem->_objStewardshipStackArray[] = StewardshipStack::InstantiateDbRow($objDbRow, $strAliasPrefix . 'stewardshipstack__', $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_batch__') {
                 $strAliasPrefix = null;
             }
         }
     }
     // Create a new instance of the StewardshipBatch object
     $objToReturn = new StewardshipBatch();
     $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_status_type_id', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'stewardship_batch_status_type_id'] : $strAliasPrefix . 'stewardship_batch_status_type_id';
     $objToReturn->intStewardshipBatchStatusTypeId = $objDbRow->GetColumn($strAliasName, 'Integer');
     $strAliasName = array_key_exists($strAliasPrefix . 'date_entered', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'date_entered'] : $strAliasPrefix . 'date_entered';
     $objToReturn->dttDateEntered = $objDbRow->GetColumn($strAliasName, 'Date');
     $strAliasName = array_key_exists($strAliasPrefix . 'date_credited', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'date_credited'] : $strAliasPrefix . 'date_credited';
     $objToReturn->dttDateCredited = $objDbRow->GetColumn($strAliasName, 'Date');
     $strAliasName = array_key_exists($strAliasPrefix . 'batch_label', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'batch_label'] : $strAliasPrefix . 'batch_label';
     $objToReturn->strBatchLabel = $objDbRow->GetColumn($strAliasName, 'VarChar');
     $strAliasName = array_key_exists($strAliasPrefix . 'description', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'description'] : $strAliasPrefix . 'description';
     $objToReturn->strDescription = $objDbRow->GetColumn($strAliasName, 'VarChar');
     $strAliasName = array_key_exists($strAliasPrefix . 'item_count', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'item_count'] : $strAliasPrefix . 'item_count';
     $objToReturn->intItemCount = $objDbRow->GetColumn($strAliasName, 'Integer');
     $strAliasName = array_key_exists($strAliasPrefix . 'reported_total_amount', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'reported_total_amount'] : $strAliasPrefix . 'reported_total_amount';
     $objToReturn->fltReportedTotalAmount = $objDbRow->GetColumn($strAliasName, 'Float');
     $strAliasName = array_key_exists($strAliasPrefix . 'actual_total_amount', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'actual_total_amount'] : $strAliasPrefix . 'actual_total_amount';
     $objToReturn->fltActualTotalAmount = $objDbRow->GetColumn($strAliasName, 'Float');
     $strAliasName = array_key_exists($strAliasPrefix . 'posted_total_amount', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'posted_total_amount'] : $strAliasPrefix . 'posted_total_amount';
     $objToReturn->fltPostedTotalAmount = $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_batch__';
     }
     // Check for CreatedByLogin Early Binding
     $strAlias = $strAliasPrefix . 'created_by_login_id__id';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     if (!is_null($objDbRow->GetColumn($strAliasName))) {
         $objToReturn->objCreatedByLogin = Login::InstantiateDbRow($objDbRow, $strAliasPrefix . 'created_by_login_id__', $strExpandAsArrayNodes, null, $strColumnAliasArray);
     }
     // Check for PaypalBatch Unique ReverseReference Binding
     $strAlias = $strAliasPrefix . 'paypalbatch__id';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     if ($objDbRow->ColumnExists($strAliasName)) {
         if (!is_null($objDbRow->GetColumn($strAliasName))) {
             $objToReturn->objPaypalBatch = PaypalBatch::InstantiateDbRow($objDbRow, $strAliasPrefix . 'paypalbatch__', $strExpandAsArrayNodes, null, $strColumnAliasArray);
         } else {
             // We ATTEMPTED to do an Early Bind but the Object Doesn't Exist
             // Let's set to FALSE so that the object knows not to try and re-query again
             $objToReturn->objPaypalBatch = false;
         }
     }
     // Check for StewardshipContribution Virtual Binding
     $strAlias = $strAliasPrefix . 'stewardshipcontribution__id';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     if (!is_null($objDbRow->GetColumn($strAliasName))) {
         if ($strExpandAsArrayNodes && array_key_exists($strAlias, $strExpandAsArrayNodes)) {
             $objToReturn->_objStewardshipContributionArray[] = StewardshipContribution::InstantiateDbRow($objDbRow, $strAliasPrefix . 'stewardshipcontribution__', $strExpandAsArrayNodes, null, $strColumnAliasArray);
         } else {
             $objToReturn->_objStewardshipContribution = StewardshipContribution::InstantiateDbRow($objDbRow, $strAliasPrefix . 'stewardshipcontribution__', $strExpandAsArrayNodes, null, $strColumnAliasArray);
         }
     }
     // Check for StewardshipPost Virtual Binding
     $strAlias = $strAliasPrefix . 'stewardshippost__id';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     if (!is_null($objDbRow->GetColumn($strAliasName))) {
         if ($strExpandAsArrayNodes && array_key_exists($strAlias, $strExpandAsArrayNodes)) {
             $objToReturn->_objStewardshipPostArray[] = StewardshipPost::InstantiateDbRow($objDbRow, $strAliasPrefix . 'stewardshippost__', $strExpandAsArrayNodes, null, $strColumnAliasArray);
         } else {
             $objToReturn->_objStewardshipPost = StewardshipPost::InstantiateDbRow($objDbRow, $strAliasPrefix . 'stewardshippost__', $strExpandAsArrayNodes, null, $strColumnAliasArray);
         }
     }
     // Check for StewardshipStack Virtual Binding
     $strAlias = $strAliasPrefix . 'stewardshipstack__id';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     if (!is_null($objDbRow->GetColumn($strAliasName))) {
         if ($strExpandAsArrayNodes && array_key_exists($strAlias, $strExpandAsArrayNodes)) {
             $objToReturn->_objStewardshipStackArray[] = StewardshipStack::InstantiateDbRow($objDbRow, $strAliasPrefix . 'stewardshipstack__', $strExpandAsArrayNodes, null, $strColumnAliasArray);
         } else {
             $objToReturn->_objStewardshipStack = StewardshipStack::InstantiateDbRow($objDbRow, $strAliasPrefix . 'stewardshipstack__', $strExpandAsArrayNodes, null, $strColumnAliasArray);
         }
     }
     return $objToReturn;
 }
 /**
  * Instantiate a StewardshipContribution from a Database Row.
  * Takes in an optional strAliasPrefix, used in case another Object::InstantiateDbRow
  * is calling this StewardshipContribution::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 StewardshipContribution
  */
 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_contribution__';
         }
         $strAlias = $strAliasPrefix . 'stewardshipcontributionamount__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->_objStewardshipContributionAmountArray)) {
                 $objPreviousChildItem = $objPreviousItem->_objStewardshipContributionAmountArray[$intPreviousChildItemCount - 1];
                 $objChildItem = StewardshipContributionAmount::InstantiateDbRow($objDbRow, $strAliasPrefix . 'stewardshipcontributionamount__', $strExpandAsArrayNodes, $objPreviousChildItem, $strColumnAliasArray);
                 if ($objChildItem) {
                     $objPreviousItem->_objStewardshipContributionAmountArray[] = $objChildItem;
                 }
             } else {
                 $objPreviousItem->_objStewardshipContributionAmountArray[] = StewardshipContributionAmount::InstantiateDbRow($objDbRow, $strAliasPrefix . 'stewardshipcontributionamount__', $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_contribution__') {
                 $strAliasPrefix = null;
             }
         }
     }
     // Create a new instance of the StewardshipContribution object
     $objToReturn = new StewardshipContribution();
     $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 . 'stewardship_contribution_type_id', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'stewardship_contribution_type_id'] : $strAliasPrefix . 'stewardship_contribution_type_id';
     $objToReturn->intStewardshipContributionTypeId = $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 . 'stewardship_stack_id', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'stewardship_stack_id'] : $strAliasPrefix . 'stewardship_stack_id';
     $objToReturn->intStewardshipStackId = $objDbRow->GetColumn($strAliasName, 'Integer');
     $strAliasName = array_key_exists($strAliasPrefix . 'checking_account_lookup_id', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'checking_account_lookup_id'] : $strAliasPrefix . 'checking_account_lookup_id';
     $objToReturn->intCheckingAccountLookupId = $objDbRow->GetColumn($strAliasName, 'Integer');
     $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 . 'date_entered', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'date_entered'] : $strAliasPrefix . 'date_entered';
     $objToReturn->dttDateEntered = $objDbRow->GetColumn($strAliasName, 'DateTime');
     $strAliasName = array_key_exists($strAliasPrefix . 'date_cleared', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'date_cleared'] : $strAliasPrefix . 'date_cleared';
     $objToReturn->dttDateCleared = $objDbRow->GetColumn($strAliasName, 'DateTime');
     $strAliasName = array_key_exists($strAliasPrefix . 'date_credited', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'date_credited'] : $strAliasPrefix . 'date_credited';
     $objToReturn->dttDateCredited = $objDbRow->GetColumn($strAliasName, 'Date');
     $strAliasName = array_key_exists($strAliasPrefix . 'check_number', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'check_number'] : $strAliasPrefix . 'check_number';
     $objToReturn->strCheckNumber = $objDbRow->GetColumn($strAliasName, 'VarChar');
     $strAliasName = array_key_exists($strAliasPrefix . 'authorization_number', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'authorization_number'] : $strAliasPrefix . 'authorization_number';
     $objToReturn->strAuthorizationNumber = $objDbRow->GetColumn($strAliasName, 'VarChar');
     $strAliasName = array_key_exists($strAliasPrefix . 'alternate_source', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'alternate_source'] : $strAliasPrefix . 'alternate_source';
     $objToReturn->strAlternateSource = $objDbRow->GetColumn($strAliasName, 'VarChar');
     $strAliasName = array_key_exists($strAliasPrefix . 'non_deductible_flag', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'non_deductible_flag'] : $strAliasPrefix . 'non_deductible_flag';
     $objToReturn->blnNonDeductibleFlag = $objDbRow->GetColumn($strAliasName, 'Bit');
     $strAliasName = array_key_exists($strAliasPrefix . 'note', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'note'] : $strAliasPrefix . 'note';
     $objToReturn->strNote = $objDbRow->GetColumn($strAliasName, 'Blob');
     $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');
     $strAliasName = array_key_exists($strAliasPrefix . 'unposted_flag', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'unposted_flag'] : $strAliasPrefix . 'unposted_flag';
     $objToReturn->blnUnpostedFlag = $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 = 'stewardship_contribution__';
     }
     // 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 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 StewardshipStack Early Binding
     $strAlias = $strAliasPrefix . 'stewardship_stack_id__id';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     if (!is_null($objDbRow->GetColumn($strAliasName))) {
         $objToReturn->objStewardshipStack = StewardshipStack::InstantiateDbRow($objDbRow, $strAliasPrefix . 'stewardship_stack_id__', $strExpandAsArrayNodes, null, $strColumnAliasArray);
     }
     // Check for CheckingAccountLookup Early Binding
     $strAlias = $strAliasPrefix . 'checking_account_lookup_id__id';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     if (!is_null($objDbRow->GetColumn($strAliasName))) {
         $objToReturn->objCheckingAccountLookup = CheckingAccountLookup::InstantiateDbRow($objDbRow, $strAliasPrefix . 'checking_account_lookup_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;
     if (!is_null($objDbRow->GetColumn($strAliasName))) {
         $objToReturn->objCreatedByLogin = Login::InstantiateDbRow($objDbRow, $strAliasPrefix . 'created_by_login_id__', $strExpandAsArrayNodes, null, $strColumnAliasArray);
     }
     // Check for CreditCardPayment Unique ReverseReference Binding
     $strAlias = $strAliasPrefix . 'creditcardpayment__id';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     if ($objDbRow->ColumnExists($strAliasName)) {
         if (!is_null($objDbRow->GetColumn($strAliasName))) {
             $objToReturn->objCreditCardPayment = CreditCardPayment::InstantiateDbRow($objDbRow, $strAliasPrefix . 'creditcardpayment__', $strExpandAsArrayNodes, null, $strColumnAliasArray);
         } else {
             // We ATTEMPTED to do an Early Bind but the Object Doesn't Exist
             // Let's set to FALSE so that the object knows not to try and re-query again
             $objToReturn->objCreditCardPayment = false;
         }
     }
     // Check for StewardshipContributionAmount Virtual Binding
     $strAlias = $strAliasPrefix . 'stewardshipcontributionamount__id';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     if (!is_null($objDbRow->GetColumn($strAliasName))) {
         if ($strExpandAsArrayNodes && array_key_exists($strAlias, $strExpandAsArrayNodes)) {
             $objToReturn->_objStewardshipContributionAmountArray[] = StewardshipContributionAmount::InstantiateDbRow($objDbRow, $strAliasPrefix . 'stewardshipcontributionamount__', $strExpandAsArrayNodes, null, $strColumnAliasArray);
         } else {
             $objToReturn->_objStewardshipContributionAmount = StewardshipContributionAmount::InstantiateDbRow($objDbRow, $strAliasPrefix . 'stewardshipcontributionamount__', $strExpandAsArrayNodes, null, $strColumnAliasArray);
         }
     }
     // Check for StewardshipPostLineItem Virtual Binding
     $strAlias = $strAliasPrefix . 'stewardshippostlineitem__id';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     if (!is_null($objDbRow->GetColumn($strAliasName))) {
         if ($strExpandAsArrayNodes && array_key_exists($strAlias, $strExpandAsArrayNodes)) {
             $objToReturn->_objStewardshipPostLineItemArray[] = StewardshipPostLineItem::InstantiateDbRow($objDbRow, $strAliasPrefix . 'stewardshippostlineitem__', $strExpandAsArrayNodes, null, $strColumnAliasArray);
         } else {
             $objToReturn->_objStewardshipPostLineItem = StewardshipPostLineItem::InstantiateDbRow($objDbRow, $strAliasPrefix . 'stewardshippostlineitem__', $strExpandAsArrayNodes, null, $strColumnAliasArray);
         }
     }
     return $objToReturn;
 }