public function dtgRecurringDonation_Bind() { $this->dtgRecurringDonation->DataSource = RecurringDonation::LoadArrayByPersonId(QApplication::$PublicLogin->Person->Id); }
/** * This will save this object's RecurringPayments instance, * updating only the fields which have had a control created for it. */ public function SaveRecurringPayments() { try { // Update any fields for controls that have been created if ($this->txtName) { $this->objRecurringPayments->Name = $this->txtName->Text; } if ($this->lstPaymentPeriod) { $this->objRecurringPayments->PaymentPeriodId = $this->lstPaymentPeriod->SelectedValue; } if ($this->txtAmount) { $this->objRecurringPayments->Amount = $this->txtAmount->Text; } if ($this->calStartDate) { $this->objRecurringPayments->StartDate = $this->calStartDate->DateTime; } if ($this->calEndDate) { $this->objRecurringPayments->EndDate = $this->calEndDate->DateTime; } if ($this->chkAuthorizeFlag) { $this->objRecurringPayments->AuthorizeFlag = $this->chkAuthorizeFlag->Checked; } if ($this->txtCardHolderName) { $this->objRecurringPayments->CardHolderName = $this->txtCardHolderName->Text; } if ($this->txtAddress1) { $this->objRecurringPayments->Address1 = $this->txtAddress1->Text; } if ($this->txtAddress2) { $this->objRecurringPayments->Address2 = $this->txtAddress2->Text; } if ($this->txtCity) { $this->objRecurringPayments->City = $this->txtCity->Text; } if ($this->txtState) { $this->objRecurringPayments->State = $this->txtState->Text; } if ($this->txtZip) { $this->objRecurringPayments->Zip = $this->txtZip->Text; } if ($this->lstCreditCardType) { $this->objRecurringPayments->CreditCardTypeId = $this->lstCreditCardType->SelectedValue; } if ($this->txtAccountNumber) { $this->objRecurringPayments->AccountNumber = $this->txtAccountNumber->Text; } if ($this->txtExpirationDate) { $this->objRecurringPayments->ExpirationDate = $this->txtExpirationDate->Text; } if ($this->txtSecurityCode) { $this->objRecurringPayments->SecurityCode = $this->txtSecurityCode->Text; } // Update any UniqueReverseReferences (if any) for controls that have been created for it if ($this->lstRecurringDonationAsRecurringPayment) { $this->objRecurringPayments->RecurringDonationAsRecurringPayment = RecurringDonation::Load($this->lstRecurringDonationAsRecurringPayment->SelectedValue); } // Save the RecurringPayments object $this->objRecurringPayments->Save(); // Finally, update any ManyToManyReferences (if any) } catch (QCallerException $objExc) { $objExc->IncrementOffset(); throw $objExc; } }
/** * Override method to perform a property "Get" * This will get the value of $strName * * @param string $strName Name of the property to get * @return mixed */ public function __get($strName) { switch ($strName) { /////////////////// // Member Variables /////////////////// case 'Id': // Gets the value for intId (Read-Only PK) // @return integer return $this->intId; case 'Name': // Gets the value for strName // @return string return $this->strName; case 'PaymentPeriodId': // Gets the value for intPaymentPeriodId (Not Null) // @return integer return $this->intPaymentPeriodId; case 'Amount': // Gets the value for fltAmount // @return double return $this->fltAmount; case 'StartDate': // Gets the value for dttStartDate // @return QDateTime return $this->dttStartDate; case 'EndDate': // Gets the value for dttEndDate // @return QDateTime return $this->dttEndDate; case 'AuthorizeFlag': // Gets the value for blnAuthorizeFlag // @return boolean return $this->blnAuthorizeFlag; case 'CardHolderName': // Gets the value for strCardHolderName // @return string return $this->strCardHolderName; case 'Address1': // Gets the value for strAddress1 // @return string return $this->strAddress1; case 'Address2': // Gets the value for strAddress2 // @return string return $this->strAddress2; case 'City': // Gets the value for strCity // @return string return $this->strCity; case 'State': // Gets the value for strState // @return string return $this->strState; case 'Zip': // Gets the value for strZip // @return string return $this->strZip; case 'CreditCardTypeId': // Gets the value for intCreditCardTypeId (Not Null) // @return integer return $this->intCreditCardTypeId; case 'AccountNumber': // Gets the value for strAccountNumber // @return string return $this->strAccountNumber; case 'ExpirationDate': // Gets the value for strExpirationDate // @return string return $this->strExpirationDate; case 'SecurityCode': // Gets the value for strSecurityCode // @return string return $this->strSecurityCode; /////////////////// // Member Objects /////////////////// /////////////////// // Member Objects /////////////////// case 'PaymentPeriod': // Gets the value for the PaymentPeriod object referenced by intPaymentPeriodId (Not Null) // @return PaymentPeriod try { if (!$this->objPaymentPeriod && !is_null($this->intPaymentPeriodId)) { $this->objPaymentPeriod = PaymentPeriod::Load($this->intPaymentPeriodId); } return $this->objPaymentPeriod; } catch (QCallerException $objExc) { $objExc->IncrementOffset(); throw $objExc; } case 'RecurringDonationAsRecurringPayment': // Gets the value for the RecurringDonation object that uniquely references this RecurringPayments // by objRecurringDonationAsRecurringPayment (Unique) // @return RecurringDonation try { if ($this->objRecurringDonationAsRecurringPayment === false) { // We've attempted early binding -- and the reverse reference object does not exist return null; } if (!$this->objRecurringDonationAsRecurringPayment) { $this->objRecurringDonationAsRecurringPayment = RecurringDonation::LoadByRecurringPaymentId($this->intId); } return $this->objRecurringDonationAsRecurringPayment; } catch (QCallerException $objExc) { $objExc->IncrementOffset(); throw $objExc; } //////////////////////////// // Virtual Object References (Many to Many and Reverse References) // (If restored via a "Many-to" expansion) //////////////////////////// //////////////////////////// // Virtual Object References (Many to Many and Reverse References) // (If restored via a "Many-to" expansion) //////////////////////////// case '_OnlineDonationAsRecurringPayment': // Gets the value for the private _objOnlineDonationAsRecurringPayment (Read-Only) // if set due to an expansion on the online_donation.recurring_payment_id reverse relationship // @return OnlineDonation return $this->_objOnlineDonationAsRecurringPayment; case '_OnlineDonationAsRecurringPaymentArray': // Gets the value for the private _objOnlineDonationAsRecurringPaymentArray (Read-Only) // if set due to an ExpandAsArray on the online_donation.recurring_payment_id reverse relationship // @return OnlineDonation[] return (array) $this->_objOnlineDonationAsRecurringPaymentArray; case '__Restored': return $this->__blnRestored; default: try { return parent::__get($strName); } catch (QCallerException $objExc) { $objExc->IncrementOffset(); throw $objExc; } } }
/** * Static Helper Method to Create using PK arguments * You must pass in the PK arguments on an object to load, or leave it blank to create a new one. * If you want to load via QueryString or PathInfo, use the CreateFromQueryString or CreateFromPathInfo * static helper methods. Finally, specify a CreateType to define whether or not we are only allowed to * edit, or if we are also allowed to create a new one, etc. * * @param mixed $objParentObject QForm or QPanel which will be using this RecurringDonationMetaControl * @param integer $intId primary key value * @param QMetaControlCreateType $intCreateType rules governing RecurringDonation object creation - defaults to CreateOrEdit * @return RecurringDonationMetaControl */ public static function Create($objParentObject, $intId = null, $intCreateType = QMetaControlCreateType::CreateOrEdit) { // Attempt to Load from PK Arguments if (strlen($intId)) { $objRecurringDonation = RecurringDonation::Load($intId); // RecurringDonation was found -- return it! if ($objRecurringDonation) { return new RecurringDonationMetaControl($objParentObject, $objRecurringDonation); } else { if ($intCreateType != QMetaControlCreateType::CreateOnRecordNotFound) { throw new QCallerException('Could not find a RecurringDonation object with PK arguments: ' . $intId); } } // If EditOnly is specified, throw an exception } else { if ($intCreateType == QMetaControlCreateType::EditOnly) { throw new QCallerException('No PK arguments specified'); } } // If we are here, then we need to create a new record return new RecurringDonationMetaControl($objParentObject, new RecurringDonation()); }
public static function GetSoapArrayFromArray($objArray) { if (!$objArray) { return null; } $objArrayToReturn = array(); foreach ($objArray as $objObject) { array_push($objArrayToReturn, RecurringDonation::GetSoapObjectFromObject($objObject, true)); } return unserialize(serialize($objArrayToReturn)); }
/** * Refresh this MetaControl with Data from the local RecurringDonationItems object. * @param boolean $blnReload reload RecurringDonationItems from the database * @return void */ public function Refresh($blnReload = false) { if ($blnReload) { $this->objRecurringDonationItems->Reload(); } if ($this->lblId) { if ($this->blnEditMode) { $this->lblId->Text = $this->objRecurringDonationItems->Id; } } if ($this->lstRecurringDonation) { $this->lstRecurringDonation->RemoveAllItems(); if (!$this->blnEditMode) { $this->lstRecurringDonation->AddItem(QApplication::Translate('- Select One -'), null); } $objRecurringDonationArray = RecurringDonation::LoadAll(); if ($objRecurringDonationArray) { foreach ($objRecurringDonationArray as $objRecurringDonation) { $objListItem = new QListItem($objRecurringDonation->__toString(), $objRecurringDonation->Id); if ($this->objRecurringDonationItems->RecurringDonation && $this->objRecurringDonationItems->RecurringDonation->Id == $objRecurringDonation->Id) { $objListItem->Selected = true; } $this->lstRecurringDonation->AddItem($objListItem); } } } if ($this->lblRecurringDonationId) { $this->lblRecurringDonationId->Text = $this->objRecurringDonationItems->RecurringDonation ? $this->objRecurringDonationItems->RecurringDonation->__toString() : null; } if ($this->txtAmount) { $this->txtAmount->Text = $this->objRecurringDonationItems->Amount; } if ($this->lblAmount) { $this->lblAmount->Text = $this->objRecurringDonationItems->Amount; } if ($this->chkDonationFlag) { $this->chkDonationFlag->Checked = $this->objRecurringDonationItems->DonationFlag; } if ($this->lblDonationFlag) { $this->lblDonationFlag->Text = $this->objRecurringDonationItems->DonationFlag ? QApplication::Translate('Yes') : QApplication::Translate('No'); } if ($this->lstStewardshipFund) { $this->lstStewardshipFund->RemoveAllItems(); $this->lstStewardshipFund->AddItem(QApplication::Translate('- Select One -'), null); $objStewardshipFundArray = StewardshipFund::LoadAll(); if ($objStewardshipFundArray) { foreach ($objStewardshipFundArray as $objStewardshipFund) { $objListItem = new QListItem($objStewardshipFund->__toString(), $objStewardshipFund->Id); if ($this->objRecurringDonationItems->StewardshipFund && $this->objRecurringDonationItems->StewardshipFund->Id == $objStewardshipFund->Id) { $objListItem->Selected = true; } $this->lstStewardshipFund->AddItem($objListItem); } } } if ($this->lblStewardshipFundId) { $this->lblStewardshipFundId->Text = $this->objRecurringDonationItems->StewardshipFund ? $this->objRecurringDonationItems->StewardshipFund->__toString() : null; } if ($this->txtOther) { $this->txtOther->Text = $this->objRecurringDonationItems->Other; } if ($this->lblOther) { $this->lblOther->Text = $this->objRecurringDonationItems->Other; } }
/** * Main utility method to aid with data binding. It is used by the default BindAllRows() databinder but * could and should be used by any custom databind methods that would be used for instances of this * MetaDataGrid, by simply passing in a custom QQCondition and/or QQClause. * * If a paginator is set on this DataBinder, it will use it. If not, then no pagination will be used. * It will also perform any sorting (if applicable). * * @param QQCondition $objConditions override the default condition of QQ::All() to the query, itself * @param QQClause[] $objOptionalClauses additional optional QQClause object or array of QQClause objects for the query * @return void */ public function MetaDataBinder(QQCondition $objCondition = null, $objOptionalClauses = null) { // Setup input parameters to default values if none passed in if (!$objCondition) { $objCondition = QQ::All(); } $objClauses = $objOptionalClauses ? $objOptionalClauses : array(); // We need to first set the TotalItemCount, which will affect the calcuation of LimitClause below if ($this->Paginator) { $this->TotalItemCount = RecurringDonation::QueryCount($objCondition, $objClauses); } // If a column is selected to be sorted, and if that column has a OrderByClause set on it, then let's add // the OrderByClause to the $objClauses array if ($objClause = $this->OrderByClause) { array_push($objClauses, $objClause); } // Add the LimitClause information, as well if ($objClause = $this->LimitClause) { array_push($objClauses, $objClause); } // Set the DataSource to be a Query result from RecurringDonation, given the clauses above $this->DataSource = RecurringDonation::QueryArray($objCondition, $objClauses); }
public static function GetSoapObjectFromObject($objObject, $blnBindRelatedObjects) { if ($objObject->objRecurringDonation) { $objObject->objRecurringDonation = RecurringDonation::GetSoapObjectFromObject($objObject->objRecurringDonation, false); } else { if (!$blnBindRelatedObjects) { $objObject->intRecurringDonationId = null; } } if ($objObject->objStewardshipFund) { $objObject->objStewardshipFund = StewardshipFund::GetSoapObjectFromObject($objObject->objStewardshipFund, false); } else { if (!$blnBindRelatedObjects) { $objObject->intStewardshipFundId = null; } } return $objObject; }