/** * 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 'ContextId': /** * Gets the value for intContextId (Read-Only PK) * @return integer */ return $this->intContextId; case 'TextId': /** * Gets the value for intTextId (Not Null) * @return integer */ return $this->intTextId; case 'TextAccessKey': /** * Gets the value for strTextAccessKey * @return string */ return $this->strTextAccessKey; case 'TextCommandKey': /** * Gets the value for strTextCommandKey * @return string */ return $this->strTextCommandKey; case 'ProjectId': /** * Gets the value for intProjectId (Not Null) * @return integer */ return $this->intProjectId; case 'Context': /** * Gets the value for strContext (Not Null) * @return string */ return $this->strContext; case 'ContextMd5': /** * Gets the value for strContextMd5 (Not Null) * @return string */ return $this->strContextMd5; case 'Comment': /** * Gets the value for strComment * @return string */ return $this->strComment; case 'CommentMd5': /** * Gets the value for strCommentMd5 * @return string */ return $this->strCommentMd5; case 'FileId': /** * Gets the value for intFileId (Not Null) * @return integer */ return $this->intFileId; 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 'Active': /** * Gets the value for blnActive (Not Null) * @return boolean */ return $this->blnActive; /////////////////// // Member Objects /////////////////// /////////////////// // Member Objects /////////////////// case 'Text': /** * Gets the value for the NarroText object referenced by intTextId (Not Null) * @return NarroText */ try { if (!$this->objText && !is_null($this->intTextId)) { $this->objText = NarroText::Load($this->intTextId); } return $this->objText; } catch (QCallerException $objExc) { $objExc->IncrementOffset(); throw $objExc; } case 'Project': /** * Gets the value for the NarroProject object referenced by intProjectId (Not Null) * @return NarroProject */ try { if (!$this->objProject && !is_null($this->intProjectId)) { $this->objProject = NarroProject::Load($this->intProjectId); } return $this->objProject; } catch (QCallerException $objExc) { $objExc->IncrementOffset(); throw $objExc; } case 'File': /** * Gets the value for the NarroFile object referenced by intFileId (Not Null) * @return NarroFile */ try { if (!$this->objFile && !is_null($this->intFileId)) { $this->objFile = NarroFile::Load($this->intFileId); } return $this->objFile; } 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 '_NarroContextInfoAsContext': /** * Gets the value for the private _objNarroContextInfoAsContext (Read-Only) * if set due to an expansion on the narro_context_info.context_id reverse relationship * @return NarroContextInfo */ return $this->_objNarroContextInfoAsContext; case '_NarroContextInfoAsContextArray': /** * Gets the value for the private _objNarroContextInfoAsContextArray (Read-Only) * if set due to an ExpandAsArray on the narro_context_info.context_id reverse relationship * @return NarroContextInfo[] */ return $this->_objNarroContextInfoAsContextArray; case '_NarroSuggestionVoteAsContext': /** * Gets the value for the private _objNarroSuggestionVoteAsContext (Read-Only) * if set due to an expansion on the narro_suggestion_vote.context_id reverse relationship * @return NarroSuggestionVote */ return $this->_objNarroSuggestionVoteAsContext; case '_NarroSuggestionVoteAsContextArray': /** * Gets the value for the private _objNarroSuggestionVoteAsContextArray (Read-Only) * if set due to an ExpandAsArray on the narro_suggestion_vote.context_id reverse relationship * @return NarroSuggestionVote[] */ return $this->_objNarroSuggestionVoteAsContextArray; case '__Restored': return $this->__blnRestored; default: try { return parent::__get($strName); } 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 'TextCommentId': /** * Gets the value for intTextCommentId (Read-Only PK) * @return integer */ return $this->intTextCommentId; case 'TextId': /** * Gets the value for intTextId (Not Null) * @return integer */ return $this->intTextId; case 'UserId': /** * Gets the value for intUserId (Not Null) * @return integer */ return $this->intUserId; case 'LanguageId': /** * Gets the value for intLanguageId (Not Null) * @return integer */ return $this->intLanguageId; 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 'Text': /** * Gets the value for the NarroText object referenced by intTextId (Not Null) * @return NarroText */ try { if (!$this->objText && !is_null($this->intTextId)) { $this->objText = NarroText::Load($this->intTextId); } return $this->objText; } catch (QCallerException $objExc) { $objExc->IncrementOffset(); throw $objExc; } case 'User': /** * Gets the value for the NarroUser object referenced by intUserId (Not Null) * @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; } 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; } //////////////////////////// // 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; } } }
/** * 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 (Read-Only PK) * @return integer */ return $this->intSuggestionId; case 'UserId': /** * Gets the value for intUserId * @return integer */ return $this->intUserId; case 'TextId': /** * Gets the value for intTextId (Not Null) * @return integer */ return $this->intTextId; case 'LanguageId': /** * Gets the value for intLanguageId (Not Null) * @return integer */ return $this->intLanguageId; case 'SuggestionValue': /** * Gets the value for strSuggestionValue (Not Null) * @return string */ return $this->strSuggestionValue; case 'SuggestionValueMd5': /** * Gets the value for strSuggestionValueMd5 (Not Null) * @return string */ return $this->strSuggestionValueMd5; case 'SuggestionCharCount': /** * Gets the value for intSuggestionCharCount * @return integer */ return $this->intSuggestionCharCount; case 'SuggestionWordCount': /** * Gets the value for intSuggestionWordCount * @return integer */ return $this->intSuggestionWordCount; case 'HasComments': /** * Gets the value for blnHasComments * @return boolean */ return $this->blnHasComments; case 'IsImported': /** * Gets the value for blnIsImported (Not Null) * @return boolean */ return $this->blnIsImported; 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 'User': /** * Gets the value for the NarroUser object referenced by intUserId * @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; } case 'Text': /** * Gets the value for the NarroText object referenced by intTextId (Not Null) * @return NarroText */ try { if (!$this->objText && !is_null($this->intTextId)) { $this->objText = NarroText::Load($this->intTextId); } return $this->objText; } 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; } //////////////////////////// // 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 '_NarroContextInfoAsValidSuggestion': /** * Gets the value for the private _objNarroContextInfoAsValidSuggestion (Read-Only) * if set due to an expansion on the narro_context_info.valid_suggestion_id reverse relationship * @return NarroContextInfo */ return $this->_objNarroContextInfoAsValidSuggestion; case '_NarroContextInfoAsValidSuggestionArray': /** * Gets the value for the private _objNarroContextInfoAsValidSuggestionArray (Read-Only) * if set due to an ExpandAsArray on the narro_context_info.valid_suggestion_id reverse relationship * @return NarroContextInfo[] */ return $this->_objNarroContextInfoAsValidSuggestionArray; case '_NarroSuggestionVoteAsSuggestion': /** * Gets the value for the private _objNarroSuggestionVoteAsSuggestion (Read-Only) * if set due to an expansion on the narro_suggestion_vote.suggestion_id reverse relationship * @return NarroSuggestionVote */ return $this->_objNarroSuggestionVoteAsSuggestion; case '_NarroSuggestionVoteAsSuggestionArray': /** * Gets the value for the private _objNarroSuggestionVoteAsSuggestionArray (Read-Only) * if set due to an ExpandAsArray on the narro_suggestion_vote.suggestion_id reverse relationship * @return NarroSuggestionVote[] */ return $this->_objNarroSuggestionVoteAsSuggestionArray; case '__Restored': return $this->__blnRestored; default: try { return parent::__get($strName); } catch (QCallerException $objExc) { $objExc->IncrementOffset(); throw $objExc; } } }
/** * Reload this NarroText 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 NarroText object.'); } $this->DeleteCache(); // Reload the Object $objReloaded = NarroText::Load($this->intTextId); // Update $this's local variables to match $this->strTextValue = $objReloaded->strTextValue; $this->strTextValueMd5 = $objReloaded->strTextValueMd5; $this->intTextCharCount = $objReloaded->intTextCharCount; $this->intTextWordCount = $objReloaded->intTextWordCount; $this->blnHasComments = $objReloaded->blnHasComments; $this->dttCreated = $objReloaded->dttCreated; $this->dttModified = $objReloaded->dttModified; }
/** * 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 NarroTextMetaControl * @param integer $intTextId primary key value * @param QMetaControlCreateType $intCreateType rules governing NarroText object creation - defaults to CreateOrEdit * @return NarroTextMetaControl */ public static function Create($objParentObject, $intTextId = null, $intCreateType = QMetaControlCreateType::CreateOrEdit) { // Attempt to Load from PK Arguments if (strlen($intTextId)) { $objNarroText = NarroText::Load($intTextId); // NarroText was found -- return it! if ($objNarroText) { return new NarroTextMetaControl($objParentObject, $objNarroText); } else { if ($intCreateType != QMetaControlCreateType::CreateOnRecordNotFound) { throw new QCallerException('Could not find a NarroText object with PK arguments: ' . $intTextId); } } // 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 NarroTextMetaControl($objParentObject, new NarroText()); }