示例#1
0
 /**
  * Instantiate a SignupPayment from a Database Row.
  * Takes in an optional strAliasPrefix, used in case another Object::InstantiateDbRow
  * is calling this SignupPayment::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 SignupPayment
  */
 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 SignupPayment object
     $objToReturn = new SignupPayment();
     $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 . 'signup_payment_type_id', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'signup_payment_type_id'] : $strAliasPrefix . 'signup_payment_type_id';
     $objToReturn->intSignupPaymentTypeId = $objDbRow->GetColumn($strAliasName, 'Integer');
     $strAliasName = array_key_exists($strAliasPrefix . 'transaction_date', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'transaction_date'] : $strAliasPrefix . 'transaction_date';
     $objToReturn->dttTransactionDate = $objDbRow->GetColumn($strAliasName, 'DateTime');
     $strAliasName = array_key_exists($strAliasPrefix . 'transaction_description', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'transaction_description'] : $strAliasPrefix . 'transaction_description';
     $objToReturn->strTransactionDescription = $objDbRow->GetColumn($strAliasName, 'VarChar');
     $strAliasName = array_key_exists($strAliasPrefix . 'amount', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'amount'] : $strAliasPrefix . 'amount';
     $objToReturn->fltAmount = $objDbRow->GetColumn($strAliasName, 'Float');
     $strAliasName = array_key_exists($strAliasPrefix . 'funding_account', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'funding_account'] : $strAliasPrefix . 'funding_account';
     $objToReturn->strFundingAccount = $objDbRow->GetColumn($strAliasName, 'VarChar');
     $strAliasName = array_key_exists($strAliasPrefix . 'donation_stewardship_fund_id', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'donation_stewardship_fund_id'] : $strAliasPrefix . 'donation_stewardship_fund_id';
     $objToReturn->intDonationStewardshipFundId = $objDbRow->GetColumn($strAliasName, 'Integer');
     $strAliasName = array_key_exists($strAliasPrefix . 'amount_donation', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'amount_donation'] : $strAliasPrefix . 'amount_donation';
     $objToReturn->fltAmountDonation = $objDbRow->GetColumn($strAliasName, 'Float');
     $strAliasName = array_key_exists($strAliasPrefix . 'amount_non_donation', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'amount_non_donation'] : $strAliasPrefix . 'amount_non_donation';
     $objToReturn->fltAmountNonDonation = $objDbRow->GetColumn($strAliasName, 'Float');
     $strAliasName = array_key_exists($strAliasPrefix . 'credit_card_payment_id', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'credit_card_payment_id'] : $strAliasPrefix . 'credit_card_payment_id';
     $objToReturn->intCreditCardPaymentId = $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 = 'signup_payment__';
     }
     // 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 DonationStewardshipFund Early Binding
     $strAlias = $strAliasPrefix . 'donation_stewardship_fund_id__id';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     if (!is_null($objDbRow->GetColumn($strAliasName))) {
         $objToReturn->objDonationStewardshipFund = StewardshipFund::InstantiateDbRow($objDbRow, $strAliasPrefix . 'donation_stewardship_fund_id__', $strExpandAsArrayNodes, null, $strColumnAliasArray);
     }
     // Check for CreditCardPayment Early Binding
     $strAlias = $strAliasPrefix . 'credit_card_payment_id__id';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     if (!is_null($objDbRow->GetColumn($strAliasName))) {
         $objToReturn->objCreditCardPayment = CreditCardPayment::InstantiateDbRow($objDbRow, $strAliasPrefix . 'credit_card_payment_id__', $strExpandAsArrayNodes, null, $strColumnAliasArray);
     }
     return $objToReturn;
 }
 /**
  * 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;
 }
示例#3
0
 /**
  * Instantiate a single StewardshipFund 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 StewardshipFund 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 StewardshipFund::InstantiateDbRow($objDbRow, null, $strExpandAsArrayNodes, null, $strColumnAliasArray);
 }
示例#4
0
 /**
  * Instantiate a Ministry from a Database Row.
  * Takes in an optional strAliasPrefix, used in case another Object::InstantiateDbRow
  * is calling this Ministry::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 Ministry
  */
 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 = 'ministry__';
         }
         $strAlias = $strAliasPrefix . 'login__login_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->_objLoginArray)) {
                 $objPreviousChildItem = $objPreviousItem->_objLoginArray[$intPreviousChildItemCount - 1];
                 $objChildItem = Login::InstantiateDbRow($objDbRow, $strAliasPrefix . 'login__login_id__', $strExpandAsArrayNodes, $objPreviousChildItem, $strColumnAliasArray);
                 if ($objChildItem) {
                     $objPreviousItem->_objLoginArray[] = $objChildItem;
                 }
             } else {
                 $objPreviousItem->_objLoginArray[] = Login::InstantiateDbRow($objDbRow, $strAliasPrefix . 'login__login_id__', $strExpandAsArrayNodes, null, $strColumnAliasArray);
             }
             $blnExpandedViaArray = true;
         }
         $strAlias = $strAliasPrefix . 'communicationlist__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->_objCommunicationListArray)) {
                 $objPreviousChildItem = $objPreviousItem->_objCommunicationListArray[$intPreviousChildItemCount - 1];
                 $objChildItem = CommunicationList::InstantiateDbRow($objDbRow, $strAliasPrefix . 'communicationlist__', $strExpandAsArrayNodes, $objPreviousChildItem, $strColumnAliasArray);
                 if ($objChildItem) {
                     $objPreviousItem->_objCommunicationListArray[] = $objChildItem;
                 }
             } else {
                 $objPreviousItem->_objCommunicationListArray[] = CommunicationList::InstantiateDbRow($objDbRow, $strAliasPrefix . 'communicationlist__', $strExpandAsArrayNodes, null, $strColumnAliasArray);
             }
             $blnExpandedViaArray = true;
         }
         $strAlias = $strAliasPrefix . '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->_objGroupArray)) {
                 $objPreviousChildItem = $objPreviousItem->_objGroupArray[$intPreviousChildItemCount - 1];
                 $objChildItem = Group::InstantiateDbRow($objDbRow, $strAliasPrefix . 'group__', $strExpandAsArrayNodes, $objPreviousChildItem, $strColumnAliasArray);
                 if ($objChildItem) {
                     $objPreviousItem->_objGroupArray[] = $objChildItem;
                 }
             } else {
                 $objPreviousItem->_objGroupArray[] = Group::InstantiateDbRow($objDbRow, $strAliasPrefix . 'group__', $strExpandAsArrayNodes, null, $strColumnAliasArray);
             }
             $blnExpandedViaArray = true;
         }
         $strAlias = $strAliasPrefix . 'grouprole__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->_objGroupRoleArray)) {
                 $objPreviousChildItem = $objPreviousItem->_objGroupRoleArray[$intPreviousChildItemCount - 1];
                 $objChildItem = GroupRole::InstantiateDbRow($objDbRow, $strAliasPrefix . 'grouprole__', $strExpandAsArrayNodes, $objPreviousChildItem, $strColumnAliasArray);
                 if ($objChildItem) {
                     $objPreviousItem->_objGroupRoleArray[] = $objChildItem;
                 }
             } else {
                 $objPreviousItem->_objGroupRoleArray[] = GroupRole::InstantiateDbRow($objDbRow, $strAliasPrefix . 'grouprole__', $strExpandAsArrayNodes, null, $strColumnAliasArray);
             }
             $blnExpandedViaArray = true;
         }
         $strAlias = $strAliasPrefix . 'childministry__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->_objChildMinistryArray)) {
                 $objPreviousChildItem = $objPreviousItem->_objChildMinistryArray[$intPreviousChildItemCount - 1];
                 $objChildItem = Ministry::InstantiateDbRow($objDbRow, $strAliasPrefix . 'childministry__', $strExpandAsArrayNodes, $objPreviousChildItem, $strColumnAliasArray);
                 if ($objChildItem) {
                     $objPreviousItem->_objChildMinistryArray[] = $objChildItem;
                 }
             } else {
                 $objPreviousItem->_objChildMinistryArray[] = Ministry::InstantiateDbRow($objDbRow, $strAliasPrefix . 'childministry__', $strExpandAsArrayNodes, null, $strColumnAliasArray);
             }
             $blnExpandedViaArray = true;
         }
         $strAlias = $strAliasPrefix . 'signupform__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->_objSignupFormArray)) {
                 $objPreviousChildItem = $objPreviousItem->_objSignupFormArray[$intPreviousChildItemCount - 1];
                 $objChildItem = SignupForm::InstantiateDbRow($objDbRow, $strAliasPrefix . 'signupform__', $strExpandAsArrayNodes, $objPreviousChildItem, $strColumnAliasArray);
                 if ($objChildItem) {
                     $objPreviousItem->_objSignupFormArray[] = $objChildItem;
                 }
             } else {
                 $objPreviousItem->_objSignupFormArray[] = SignupForm::InstantiateDbRow($objDbRow, $strAliasPrefix . 'signupform__', $strExpandAsArrayNodes, null, $strColumnAliasArray);
             }
             $blnExpandedViaArray = true;
         }
         $strAlias = $strAliasPrefix . 'stewardshipfund__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->_objStewardshipFundArray)) {
                 $objPreviousChildItem = $objPreviousItem->_objStewardshipFundArray[$intPreviousChildItemCount - 1];
                 $objChildItem = StewardshipFund::InstantiateDbRow($objDbRow, $strAliasPrefix . 'stewardshipfund__', $strExpandAsArrayNodes, $objPreviousChildItem, $strColumnAliasArray);
                 if ($objChildItem) {
                     $objPreviousItem->_objStewardshipFundArray[] = $objChildItem;
                 }
             } else {
                 $objPreviousItem->_objStewardshipFundArray[] = StewardshipFund::InstantiateDbRow($objDbRow, $strAliasPrefix . 'stewardshipfund__', $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 == 'ministry__') {
                 $strAliasPrefix = null;
             }
         }
     }
     // Create a new instance of the Ministry object
     $objToReturn = new Ministry();
     $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 . 'token', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'token'] : $strAliasPrefix . 'token';
     $objToReturn->strToken = $objDbRow->GetColumn($strAliasName, 'VarChar');
     $strAliasName = array_key_exists($strAliasPrefix . 'name', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'name'] : $strAliasPrefix . 'name';
     $objToReturn->strName = $objDbRow->GetColumn($strAliasName, 'VarChar');
     $strAliasName = array_key_exists($strAliasPrefix . 'parent_ministry_id', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'parent_ministry_id'] : $strAliasPrefix . 'parent_ministry_id';
     $objToReturn->intParentMinistryId = $objDbRow->GetColumn($strAliasName, 'Integer');
     $strAliasName = array_key_exists($strAliasPrefix . 'group_type_bitmap', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'group_type_bitmap'] : $strAliasPrefix . 'group_type_bitmap';
     $objToReturn->intGroupTypeBitmap = $objDbRow->GetColumn($strAliasName, 'Integer');
     $strAliasName = array_key_exists($strAliasPrefix . 'signup_form_type_bitmap', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'signup_form_type_bitmap'] : $strAliasPrefix . 'signup_form_type_bitmap';
     $objToReturn->intSignupFormTypeBitmap = $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 = 'ministry__';
     }
     // Check for ParentMinistry Early Binding
     $strAlias = $strAliasPrefix . 'parent_ministry_id__id';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     if (!is_null($objDbRow->GetColumn($strAliasName))) {
         $objToReturn->objParentMinistry = Ministry::InstantiateDbRow($objDbRow, $strAliasPrefix . 'parent_ministry_id__', $strExpandAsArrayNodes, null, $strColumnAliasArray);
     }
     // Check for Login Virtual Binding
     $strAlias = $strAliasPrefix . 'login__login_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->_objLoginArray[] = Login::InstantiateDbRow($objDbRow, $strAliasPrefix . 'login__login_id__', $strExpandAsArrayNodes, null, $strColumnAliasArray);
         } else {
             $objToReturn->_objLogin = Login::InstantiateDbRow($objDbRow, $strAliasPrefix . 'login__login_id__', $strExpandAsArrayNodes, null, $strColumnAliasArray);
         }
     }
     // Check for CommunicationList Virtual Binding
     $strAlias = $strAliasPrefix . 'communicationlist__id';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     if (!is_null($objDbRow->GetColumn($strAliasName))) {
         if ($strExpandAsArrayNodes && array_key_exists($strAlias, $strExpandAsArrayNodes)) {
             $objToReturn->_objCommunicationListArray[] = CommunicationList::InstantiateDbRow($objDbRow, $strAliasPrefix . 'communicationlist__', $strExpandAsArrayNodes, null, $strColumnAliasArray);
         } else {
             $objToReturn->_objCommunicationList = CommunicationList::InstantiateDbRow($objDbRow, $strAliasPrefix . 'communicationlist__', $strExpandAsArrayNodes, null, $strColumnAliasArray);
         }
     }
     // Check for Group Virtual Binding
     $strAlias = $strAliasPrefix . '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->_objGroupArray[] = Group::InstantiateDbRow($objDbRow, $strAliasPrefix . 'group__', $strExpandAsArrayNodes, null, $strColumnAliasArray);
         } else {
             $objToReturn->_objGroup = Group::InstantiateDbRow($objDbRow, $strAliasPrefix . 'group__', $strExpandAsArrayNodes, null, $strColumnAliasArray);
         }
     }
     // Check for GroupRole Virtual Binding
     $strAlias = $strAliasPrefix . 'grouprole__id';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     if (!is_null($objDbRow->GetColumn($strAliasName))) {
         if ($strExpandAsArrayNodes && array_key_exists($strAlias, $strExpandAsArrayNodes)) {
             $objToReturn->_objGroupRoleArray[] = GroupRole::InstantiateDbRow($objDbRow, $strAliasPrefix . 'grouprole__', $strExpandAsArrayNodes, null, $strColumnAliasArray);
         } else {
             $objToReturn->_objGroupRole = GroupRole::InstantiateDbRow($objDbRow, $strAliasPrefix . 'grouprole__', $strExpandAsArrayNodes, null, $strColumnAliasArray);
         }
     }
     // Check for ChildMinistry Virtual Binding
     $strAlias = $strAliasPrefix . 'childministry__id';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     if (!is_null($objDbRow->GetColumn($strAliasName))) {
         if ($strExpandAsArrayNodes && array_key_exists($strAlias, $strExpandAsArrayNodes)) {
             $objToReturn->_objChildMinistryArray[] = Ministry::InstantiateDbRow($objDbRow, $strAliasPrefix . 'childministry__', $strExpandAsArrayNodes, null, $strColumnAliasArray);
         } else {
             $objToReturn->_objChildMinistry = Ministry::InstantiateDbRow($objDbRow, $strAliasPrefix . 'childministry__', $strExpandAsArrayNodes, null, $strColumnAliasArray);
         }
     }
     // Check for SignupForm Virtual Binding
     $strAlias = $strAliasPrefix . 'signupform__id';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     if (!is_null($objDbRow->GetColumn($strAliasName))) {
         if ($strExpandAsArrayNodes && array_key_exists($strAlias, $strExpandAsArrayNodes)) {
             $objToReturn->_objSignupFormArray[] = SignupForm::InstantiateDbRow($objDbRow, $strAliasPrefix . 'signupform__', $strExpandAsArrayNodes, null, $strColumnAliasArray);
         } else {
             $objToReturn->_objSignupForm = SignupForm::InstantiateDbRow($objDbRow, $strAliasPrefix . 'signupform__', $strExpandAsArrayNodes, null, $strColumnAliasArray);
         }
     }
     // Check for StewardshipFund Virtual Binding
     $strAlias = $strAliasPrefix . 'stewardshipfund__id';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     if (!is_null($objDbRow->GetColumn($strAliasName))) {
         if ($strExpandAsArrayNodes && array_key_exists($strAlias, $strExpandAsArrayNodes)) {
             $objToReturn->_objStewardshipFundArray[] = StewardshipFund::InstantiateDbRow($objDbRow, $strAliasPrefix . 'stewardshipfund__', $strExpandAsArrayNodes, null, $strColumnAliasArray);
         } else {
             $objToReturn->_objStewardshipFund = StewardshipFund::InstantiateDbRow($objDbRow, $strAliasPrefix . 'stewardshipfund__', $strExpandAsArrayNodes, null, $strColumnAliasArray);
         }
     }
     return $objToReturn;
 }
示例#5
0
 /**
  * Instantiate a SignupForm from a Database Row.
  * Takes in an optional strAliasPrefix, used in case another Object::InstantiateDbRow
  * is calling this SignupForm::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 SignupForm
  */
 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 = 'signup_form__';
         }
         $strAlias = $strAliasPrefix . 'formproduct__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->_objFormProductArray)) {
                 $objPreviousChildItem = $objPreviousItem->_objFormProductArray[$intPreviousChildItemCount - 1];
                 $objChildItem = FormProduct::InstantiateDbRow($objDbRow, $strAliasPrefix . 'formproduct__', $strExpandAsArrayNodes, $objPreviousChildItem, $strColumnAliasArray);
                 if ($objChildItem) {
                     $objPreviousItem->_objFormProductArray[] = $objChildItem;
                 }
             } else {
                 $objPreviousItem->_objFormProductArray[] = FormProduct::InstantiateDbRow($objDbRow, $strAliasPrefix . 'formproduct__', $strExpandAsArrayNodes, null, $strColumnAliasArray);
             }
             $blnExpandedViaArray = true;
         }
         $strAlias = $strAliasPrefix . 'formquestion__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->_objFormQuestionArray)) {
                 $objPreviousChildItem = $objPreviousItem->_objFormQuestionArray[$intPreviousChildItemCount - 1];
                 $objChildItem = FormQuestion::InstantiateDbRow($objDbRow, $strAliasPrefix . 'formquestion__', $strExpandAsArrayNodes, $objPreviousChildItem, $strColumnAliasArray);
                 if ($objChildItem) {
                     $objPreviousItem->_objFormQuestionArray[] = $objChildItem;
                 }
             } else {
                 $objPreviousItem->_objFormQuestionArray[] = FormQuestion::InstantiateDbRow($objDbRow, $strAliasPrefix . 'formquestion__', $strExpandAsArrayNodes, null, $strColumnAliasArray);
             }
             $blnExpandedViaArray = true;
         }
         $strAlias = $strAliasPrefix . 'signupentry__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->_objSignupEntryArray)) {
                 $objPreviousChildItem = $objPreviousItem->_objSignupEntryArray[$intPreviousChildItemCount - 1];
                 $objChildItem = SignupEntry::InstantiateDbRow($objDbRow, $strAliasPrefix . 'signupentry__', $strExpandAsArrayNodes, $objPreviousChildItem, $strColumnAliasArray);
                 if ($objChildItem) {
                     $objPreviousItem->_objSignupEntryArray[] = $objChildItem;
                 }
             } else {
                 $objPreviousItem->_objSignupEntryArray[] = SignupEntry::InstantiateDbRow($objDbRow, $strAliasPrefix . 'signupentry__', $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 == 'signup_form__') {
                 $strAliasPrefix = null;
             }
         }
     }
     // Create a new instance of the SignupForm object
     $objToReturn = new SignupForm();
     $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_form_type_id', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'signup_form_type_id'] : $strAliasPrefix . 'signup_form_type_id';
     $objToReturn->intSignupFormTypeId = $objDbRow->GetColumn($strAliasName, 'Integer');
     $strAliasName = array_key_exists($strAliasPrefix . 'ministry_id', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'ministry_id'] : $strAliasPrefix . 'ministry_id';
     $objToReturn->intMinistryId = $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 . 'active_flag', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'active_flag'] : $strAliasPrefix . 'active_flag';
     $objToReturn->blnActiveFlag = $objDbRow->GetColumn($strAliasName, 'Bit');
     $strAliasName = array_key_exists($strAliasPrefix . 'confidential_flag', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'confidential_flag'] : $strAliasPrefix . 'confidential_flag';
     $objToReturn->blnConfidentialFlag = $objDbRow->GetColumn($strAliasName, 'Bit');
     $strAliasName = array_key_exists($strAliasPrefix . 'description', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'description'] : $strAliasPrefix . 'description';
     $objToReturn->strDescription = $objDbRow->GetColumn($strAliasName, 'Blob');
     $strAliasName = array_key_exists($strAliasPrefix . 'information_url', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'information_url'] : $strAliasPrefix . 'information_url';
     $objToReturn->strInformationUrl = $objDbRow->GetColumn($strAliasName, 'VarChar');
     $strAliasName = array_key_exists($strAliasPrefix . 'support_email', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'support_email'] : $strAliasPrefix . 'support_email';
     $objToReturn->strSupportEmail = $objDbRow->GetColumn($strAliasName, 'VarChar');
     $strAliasName = array_key_exists($strAliasPrefix . 'email_notification', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'email_notification'] : $strAliasPrefix . 'email_notification';
     $objToReturn->strEmailNotification = $objDbRow->GetColumn($strAliasName, 'Blob');
     $strAliasName = array_key_exists($strAliasPrefix . 'allow_other_flag', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'allow_other_flag'] : $strAliasPrefix . 'allow_other_flag';
     $objToReturn->blnAllowOtherFlag = $objDbRow->GetColumn($strAliasName, 'Bit');
     $strAliasName = array_key_exists($strAliasPrefix . 'allow_multiple_flag', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'allow_multiple_flag'] : $strAliasPrefix . 'allow_multiple_flag';
     $objToReturn->blnAllowMultipleFlag = $objDbRow->GetColumn($strAliasName, 'Bit');
     $strAliasName = array_key_exists($strAliasPrefix . 'signup_limit', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'signup_limit'] : $strAliasPrefix . 'signup_limit';
     $objToReturn->intSignupLimit = $objDbRow->GetColumn($strAliasName, 'Integer');
     $strAliasName = array_key_exists($strAliasPrefix . 'signup_male_limit', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'signup_male_limit'] : $strAliasPrefix . 'signup_male_limit';
     $objToReturn->intSignupMaleLimit = $objDbRow->GetColumn($strAliasName, 'Integer');
     $strAliasName = array_key_exists($strAliasPrefix . 'signup_female_limit', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'signup_female_limit'] : $strAliasPrefix . 'signup_female_limit';
     $objToReturn->intSignupFemaleLimit = $objDbRow->GetColumn($strAliasName, 'Integer');
     $strAliasName = array_key_exists($strAliasPrefix . 'funding_account', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'funding_account'] : $strAliasPrefix . 'funding_account';
     $objToReturn->strFundingAccount = $objDbRow->GetColumn($strAliasName, 'VarChar');
     $strAliasName = array_key_exists($strAliasPrefix . 'donation_stewardship_fund_id', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'donation_stewardship_fund_id'] : $strAliasPrefix . 'donation_stewardship_fund_id';
     $objToReturn->intDonationStewardshipFundId = $objDbRow->GetColumn($strAliasName, 'Integer');
     $strAliasName = array_key_exists($strAliasPrefix . 'date_created', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'date_created'] : $strAliasPrefix . 'date_created';
     $objToReturn->dttDateCreated = $objDbRow->GetColumn($strAliasName, 'DateTime');
     $strAliasName = array_key_exists($strAliasPrefix . 'login_not_required_flag', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'login_not_required_flag'] : $strAliasPrefix . 'login_not_required_flag';
     $objToReturn->blnLoginNotRequiredFlag = $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 = 'signup_form__';
     }
     // Check for Ministry Early Binding
     $strAlias = $strAliasPrefix . 'ministry_id__id';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     if (!is_null($objDbRow->GetColumn($strAliasName))) {
         $objToReturn->objMinistry = Ministry::InstantiateDbRow($objDbRow, $strAliasPrefix . 'ministry_id__', $strExpandAsArrayNodes, null, $strColumnAliasArray);
     }
     // Check for DonationStewardshipFund Early Binding
     $strAlias = $strAliasPrefix . 'donation_stewardship_fund_id__id';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     if (!is_null($objDbRow->GetColumn($strAliasName))) {
         $objToReturn->objDonationStewardshipFund = StewardshipFund::InstantiateDbRow($objDbRow, $strAliasPrefix . 'donation_stewardship_fund_id__', $strExpandAsArrayNodes, null, $strColumnAliasArray);
     }
     // Check for ClassMeeting Unique ReverseReference Binding
     $strAlias = $strAliasPrefix . 'classmeeting__signup_form_id';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     if ($objDbRow->ColumnExists($strAliasName)) {
         if (!is_null($objDbRow->GetColumn($strAliasName))) {
             $objToReturn->objClassMeeting = ClassMeeting::InstantiateDbRow($objDbRow, $strAliasPrefix . 'classmeeting__', $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->objClassMeeting = false;
         }
     }
     // Check for EventSignupForm Unique ReverseReference Binding
     $strAlias = $strAliasPrefix . 'eventsignupform__signup_form_id';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     if ($objDbRow->ColumnExists($strAliasName)) {
         if (!is_null($objDbRow->GetColumn($strAliasName))) {
             $objToReturn->objEventSignupForm = EventSignupForm::InstantiateDbRow($objDbRow, $strAliasPrefix . 'eventsignupform__', $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->objEventSignupForm = false;
         }
     }
     // Check for FormProduct Virtual Binding
     $strAlias = $strAliasPrefix . 'formproduct__id';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     if (!is_null($objDbRow->GetColumn($strAliasName))) {
         if ($strExpandAsArrayNodes && array_key_exists($strAlias, $strExpandAsArrayNodes)) {
             $objToReturn->_objFormProductArray[] = FormProduct::InstantiateDbRow($objDbRow, $strAliasPrefix . 'formproduct__', $strExpandAsArrayNodes, null, $strColumnAliasArray);
         } else {
             $objToReturn->_objFormProduct = FormProduct::InstantiateDbRow($objDbRow, $strAliasPrefix . 'formproduct__', $strExpandAsArrayNodes, null, $strColumnAliasArray);
         }
     }
     // Check for FormQuestion Virtual Binding
     $strAlias = $strAliasPrefix . 'formquestion__id';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     if (!is_null($objDbRow->GetColumn($strAliasName))) {
         if ($strExpandAsArrayNodes && array_key_exists($strAlias, $strExpandAsArrayNodes)) {
             $objToReturn->_objFormQuestionArray[] = FormQuestion::InstantiateDbRow($objDbRow, $strAliasPrefix . 'formquestion__', $strExpandAsArrayNodes, null, $strColumnAliasArray);
         } else {
             $objToReturn->_objFormQuestion = FormQuestion::InstantiateDbRow($objDbRow, $strAliasPrefix . 'formquestion__', $strExpandAsArrayNodes, null, $strColumnAliasArray);
         }
     }
     // Check for SignupEntry Virtual Binding
     $strAlias = $strAliasPrefix . 'signupentry__id';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     if (!is_null($objDbRow->GetColumn($strAliasName))) {
         if ($strExpandAsArrayNodes && array_key_exists($strAlias, $strExpandAsArrayNodes)) {
             $objToReturn->_objSignupEntryArray[] = SignupEntry::InstantiateDbRow($objDbRow, $strAliasPrefix . 'signupentry__', $strExpandAsArrayNodes, null, $strColumnAliasArray);
         } else {
             $objToReturn->_objSignupEntry = SignupEntry::InstantiateDbRow($objDbRow, $strAliasPrefix . 'signupentry__', $strExpandAsArrayNodes, null, $strColumnAliasArray);
         }
     }
     return $objToReturn;
 }
示例#6
0
 /**
  * Instantiate a StewardshipPledge from a Database Row.
  * Takes in an optional strAliasPrefix, used in case another Object::InstantiateDbRow
  * is calling this StewardshipPledge::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 StewardshipPledge
  */
 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 StewardshipPledge object
     $objToReturn = new StewardshipPledge();
     $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_fund_id', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'stewardship_fund_id'] : $strAliasPrefix . 'stewardship_fund_id';
     $objToReturn->intStewardshipFundId = $objDbRow->GetColumn($strAliasName, 'Integer');
     $strAliasName = array_key_exists($strAliasPrefix . 'date_started', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'date_started'] : $strAliasPrefix . 'date_started';
     $objToReturn->dttDateStarted = $objDbRow->GetColumn($strAliasName, 'Date');
     $strAliasName = array_key_exists($strAliasPrefix . 'date_ended', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'date_ended'] : $strAliasPrefix . 'date_ended';
     $objToReturn->dttDateEnded = $objDbRow->GetColumn($strAliasName, 'Date');
     $strAliasName = array_key_exists($strAliasPrefix . 'pledge_amount', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'pledge_amount'] : $strAliasPrefix . 'pledge_amount';
     $objToReturn->fltPledgeAmount = $objDbRow->GetColumn($strAliasName, 'Float');
     $strAliasName = array_key_exists($strAliasPrefix . 'contributed_amount', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'contributed_amount'] : $strAliasPrefix . 'contributed_amount';
     $objToReturn->fltContributedAmount = $objDbRow->GetColumn($strAliasName, 'Float');
     $strAliasName = array_key_exists($strAliasPrefix . 'remaining_amount', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'remaining_amount'] : $strAliasPrefix . 'remaining_amount';
     $objToReturn->fltRemainingAmount = $objDbRow->GetColumn($strAliasName, 'Float');
     $strAliasName = array_key_exists($strAliasPrefix . 'fulfilled_flag', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'fulfilled_flag'] : $strAliasPrefix . 'fulfilled_flag';
     $objToReturn->blnFulfilledFlag = $objDbRow->GetColumn($strAliasName, 'Bit');
     $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 = 'stewardship_pledge__';
     }
     // 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 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;
 }