public function RenderPaymentPeriod(RecurringDonation $objDonation) { return sprintf('%s', PaymentPeriod::Load($objDonation->RecurringPayment->PaymentPeriod->Name)); }
/** * 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 PaymentPeriodMetaControl * @param integer $intId primary key value * @param QMetaControlCreateType $intCreateType rules governing PaymentPeriod object creation - defaults to CreateOrEdit * @return PaymentPeriodMetaControl */ public static function Create($objParentObject, $intId = null, $intCreateType = QMetaControlCreateType::CreateOrEdit) { // Attempt to Load from PK Arguments if (strlen($intId)) { $objPaymentPeriod = PaymentPeriod::Load($intId); // PaymentPeriod was found -- return it! if ($objPaymentPeriod) { return new PaymentPeriodMetaControl($objParentObject, $objPaymentPeriod); } else { if ($intCreateType != QMetaControlCreateType::CreateOnRecordNotFound) { throw new QCallerException('Could not find a PaymentPeriod 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 PaymentPeriodMetaControl($objParentObject, new PaymentPeriod()); }
/** * 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; } } }
/** * Reload this PaymentPeriod from the database. * @return void */ public function Reload() { // Make sure we are actually Restored from the database if (!$this->__blnRestored) { throw new QCallerException('Cannot call Reload() on a new, unsaved PaymentPeriod object.'); } // Reload the Object $objReloaded = PaymentPeriod::Load($this->intId); // Update $this's local variables to match $this->strName = $objReloaded->strName; }