/** * 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 'StewardshipPostId': // Gets the value for intStewardshipPostId (Not Null) // @return integer return $this->intStewardshipPostId; case 'StewardshipContributionId': // Gets the value for intStewardshipContributionId (Not Null) // @return integer return $this->intStewardshipContributionId; case 'PersonId': // Gets the value for intPersonId (Not Null) // @return integer return $this->intPersonId; case 'StewardshipFundId': // Gets the value for intStewardshipFundId (Not Null) // @return integer return $this->intStewardshipFundId; case 'Description': // Gets the value for strDescription // @return string return $this->strDescription; case 'Amount': // Gets the value for fltAmount // @return double return $this->fltAmount; /////////////////// // Member Objects /////////////////// /////////////////// // Member Objects /////////////////// case 'StewardshipPost': // Gets the value for the StewardshipPost object referenced by intStewardshipPostId (Not Null) // @return StewardshipPost try { if (!$this->objStewardshipPost && !is_null($this->intStewardshipPostId)) { $this->objStewardshipPost = StewardshipPost::Load($this->intStewardshipPostId); } return $this->objStewardshipPost; } catch (QCallerException $objExc) { $objExc->IncrementOffset(); throw $objExc; } case 'StewardshipContribution': // Gets the value for the StewardshipContribution object referenced by intStewardshipContributionId (Not Null) // @return StewardshipContribution try { if (!$this->objStewardshipContribution && !is_null($this->intStewardshipContributionId)) { $this->objStewardshipContribution = StewardshipContribution::Load($this->intStewardshipContributionId); } return $this->objStewardshipContribution; } catch (QCallerException $objExc) { $objExc->IncrementOffset(); throw $objExc; } case 'Person': // Gets the value for the Person object referenced by intPersonId (Not Null) // @return Person try { if (!$this->objPerson && !is_null($this->intPersonId)) { $this->objPerson = Person::Load($this->intPersonId); } return $this->objPerson; } catch (QCallerException $objExc) { $objExc->IncrementOffset(); throw $objExc; } case 'StewardshipFund': // Gets the value for the StewardshipFund object referenced by intStewardshipFundId (Not Null) // @return StewardshipFund try { if (!$this->objStewardshipFund && !is_null($this->intStewardshipFundId)) { $this->objStewardshipFund = StewardshipFund::Load($this->intStewardshipFundId); } return $this->objStewardshipFund; } 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 '__Restored': return $this->__blnRestored; default: try { return parent::__get($strName); } catch (QCallerException $objExc) { $objExc->IncrementOffset(); throw $objExc; } } }
/** * Reload this StewardshipPost 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 StewardshipPost object.'); } // Reload the Object $objReloaded = StewardshipPost::Load($this->intId); // Update $this's local variables to match $this->StewardshipBatchId = $objReloaded->StewardshipBatchId; $this->intPostNumber = $objReloaded->intPostNumber; $this->dttDatePosted = $objReloaded->dttDatePosted; $this->fltTotalAmount = $objReloaded->fltTotalAmount; $this->CreatedByLoginId = $objReloaded->CreatedByLoginId; }
/** * 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 StewardshipPostMetaControl * @param integer $intId primary key value * @param QMetaControlCreateType $intCreateType rules governing StewardshipPost object creation - defaults to CreateOrEdit * @return StewardshipPostMetaControl */ public static function Create($objParentObject, $intId = null, $intCreateType = QMetaControlCreateType::CreateOrEdit) { // Attempt to Load from PK Arguments if (strlen($intId)) { $objStewardshipPost = StewardshipPost::Load($intId); // StewardshipPost was found -- return it! if ($objStewardshipPost) { return new StewardshipPostMetaControl($objParentObject, $objStewardshipPost); } else { if ($intCreateType != QMetaControlCreateType::CreateOnRecordNotFound) { throw new QCallerException('Could not find a StewardshipPost 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 StewardshipPostMetaControl($objParentObject, new StewardshipPost()); }