/** * 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 'SuggestionId': /** * Gets the value for intSuggestionId (PK) * @return integer */ return $this->intSuggestionId; case 'ContextId': /** * Gets the value for intContextId (PK) * @return integer */ return $this->intContextId; case 'UserId': /** * Gets the value for intUserId (PK) * @return integer */ return $this->intUserId; case 'VoteValue': /** * Gets the value for intVoteValue (Not Null) * @return integer */ return $this->intVoteValue; case 'Created': /** * Gets the value for dttCreated (Not Null) * @return QDateTime */ return $this->dttCreated; case 'Modified': /** * Gets the value for dttModified * @return QDateTime */ return $this->dttModified; /////////////////// // Member Objects /////////////////// /////////////////// // Member Objects /////////////////// case 'Suggestion': /** * Gets the value for the NarroSuggestion object referenced by intSuggestionId (PK) * @return NarroSuggestion */ try { if (!$this->objSuggestion && !is_null($this->intSuggestionId)) { $this->objSuggestion = NarroSuggestion::Load($this->intSuggestionId); } return $this->objSuggestion; } catch (QCallerException $objExc) { $objExc->IncrementOffset(); throw $objExc; } case 'Context': /** * Gets the value for the NarroContext object referenced by intContextId (PK) * @return NarroContext */ try { if (!$this->objContext && !is_null($this->intContextId)) { $this->objContext = NarroContext::Load($this->intContextId); } return $this->objContext; } catch (QCallerException $objExc) { $objExc->IncrementOffset(); throw $objExc; } case 'User': /** * Gets the value for the NarroUser object referenced by intUserId (PK) * @return NarroUser */ try { if (!$this->objUser && !is_null($this->intUserId)) { $this->objUser = NarroUser::Load($this->intUserId); } return $this->objUser; } 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 NarroContext 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 NarroContext object.'); } $this->DeleteCache(); // Reload the Object $objReloaded = NarroContext::Load($this->intContextId); // Update $this's local variables to match $this->TextId = $objReloaded->TextId; $this->strTextAccessKey = $objReloaded->strTextAccessKey; $this->strTextCommandKey = $objReloaded->strTextCommandKey; $this->ProjectId = $objReloaded->ProjectId; $this->strContext = $objReloaded->strContext; $this->strContextMd5 = $objReloaded->strContextMd5; $this->strComment = $objReloaded->strComment; $this->strCommentMd5 = $objReloaded->strCommentMd5; $this->FileId = $objReloaded->FileId; $this->dttCreated = $objReloaded->dttCreated; $this->dttModified = $objReloaded->dttModified; $this->blnActive = $objReloaded->blnActive; }
/** * 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 'ContextInfoId': /** * Gets the value for intContextInfoId (Read-Only PK) * @return integer */ return $this->intContextInfoId; case 'ContextId': /** * Gets the value for intContextId (Not Null) * @return integer */ return $this->intContextId; case 'LanguageId': /** * Gets the value for intLanguageId (Not Null) * @return integer */ return $this->intLanguageId; case 'ValidatorUserId': /** * Gets the value for intValidatorUserId * @return integer */ return $this->intValidatorUserId; case 'ValidSuggestionId': /** * Gets the value for intValidSuggestionId * @return integer */ return $this->intValidSuggestionId; case 'HasSuggestions': /** * Gets the value for blnHasSuggestions * @return boolean */ return $this->blnHasSuggestions; case 'SuggestionAccessKey': /** * Gets the value for strSuggestionAccessKey * @return string */ return $this->strSuggestionAccessKey; case 'SuggestionCommandKey': /** * Gets the value for strSuggestionCommandKey * @return string */ return $this->strSuggestionCommandKey; case 'Created': /** * Gets the value for dttCreated (Not Null) * @return QDateTime */ return $this->dttCreated; case 'Modified': /** * Gets the value for dttModified * @return QDateTime */ return $this->dttModified; /////////////////// // Member Objects /////////////////// /////////////////// // Member Objects /////////////////// case 'Context': /** * Gets the value for the NarroContext object referenced by intContextId (Not Null) * @return NarroContext */ try { if (!$this->objContext && !is_null($this->intContextId)) { $this->objContext = NarroContext::Load($this->intContextId); } return $this->objContext; } catch (QCallerException $objExc) { $objExc->IncrementOffset(); throw $objExc; } case 'Language': /** * Gets the value for the NarroLanguage object referenced by intLanguageId (Not Null) * @return NarroLanguage */ try { if (!$this->objLanguage && !is_null($this->intLanguageId)) { $this->objLanguage = NarroLanguage::Load($this->intLanguageId); } return $this->objLanguage; } catch (QCallerException $objExc) { $objExc->IncrementOffset(); throw $objExc; } case 'ValidatorUser': /** * Gets the value for the NarroUser object referenced by intValidatorUserId * @return NarroUser */ try { if (!$this->objValidatorUser && !is_null($this->intValidatorUserId)) { $this->objValidatorUser = NarroUser::Load($this->intValidatorUserId); } return $this->objValidatorUser; } catch (QCallerException $objExc) { $objExc->IncrementOffset(); throw $objExc; } case 'ValidSuggestion': /** * Gets the value for the NarroSuggestion object referenced by intValidSuggestionId * @return NarroSuggestion */ try { if (!$this->objValidSuggestion && !is_null($this->intValidSuggestionId)) { $this->objValidSuggestion = NarroSuggestion::Load($this->intValidSuggestionId); } return $this->objValidSuggestion; } 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; } } }
/** * 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 NarroContextMetaControl * @param integer $intContextId primary key value * @param QMetaControlCreateType $intCreateType rules governing NarroContext object creation - defaults to CreateOrEdit * @return NarroContextMetaControl */ public static function Create($objParentObject, $intContextId = null, $intCreateType = QMetaControlCreateType::CreateOrEdit) { // Attempt to Load from PK Arguments if (strlen($intContextId)) { $objNarroContext = NarroContext::Load($intContextId); // NarroContext was found -- return it! if ($objNarroContext) { return new NarroContextMetaControl($objParentObject, $objNarroContext); } else { if ($intCreateType != QMetaControlCreateType::CreateOnRecordNotFound) { throw new QCallerException('Could not find a NarroContext object with PK arguments: ' . $intContextId); } } // 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 NarroContextMetaControl($objParentObject, new NarroContext()); }
/** * 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 'CommentId': /** * Gets the value for intCommentId (Read-Only PK) * @return integer */ return $this->intCommentId; case 'ContextId': /** * Gets the value for intContextId (Not Null) * @return integer */ return $this->intContextId; case 'Created': /** * Gets the value for dttCreated (Not Null) * @return QDateTime */ return $this->dttCreated; case 'Modified': /** * Gets the value for dttModified * @return QDateTime */ return $this->dttModified; case 'CommentText': /** * Gets the value for strCommentText (Not Null) * @return string */ return $this->strCommentText; case 'CommentTextMd5': /** * Gets the value for strCommentTextMd5 (Not Null) * @return string */ return $this->strCommentTextMd5; /////////////////// // Member Objects /////////////////// /////////////////// // Member Objects /////////////////// case 'Context': /** * Gets the value for the NarroContext object referenced by intContextId (Not Null) * @return NarroContext */ try { if (!$this->objContext && !is_null($this->intContextId)) { $this->objContext = NarroContext::Load($this->intContextId); } return $this->objContext; } 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; } } }