/** * This will save this object's Package instance, * updating only the fields which have had a control created for it. */ public function SavePackage() { try { // Update any fields for controls that have been created if ($this->lstPackageCategory) { $this->objPackage->PackageCategoryId = $this->lstPackageCategory->SelectedValue; } if ($this->txtToken) { $this->objPackage->Token = $this->txtToken->Text; } if ($this->txtName) { $this->objPackage->Name = $this->txtName->Text; } if ($this->txtDescription) { $this->objPackage->Description = $this->txtDescription->Text; } if ($this->calLastPostDate) { $this->objPackage->LastPostDate = $this->calLastPostDate->DateTime; } if ($this->lstLastPostedByPerson) { $this->objPackage->LastPostedByPersonId = $this->lstLastPostedByPerson->SelectedValue; } // Update any UniqueReverseReferences (if any) for controls that have been created for it if ($this->lstTopicLink) { $this->objPackage->TopicLink = TopicLink::Load($this->lstTopicLink->SelectedValue); } // Save the Package object $this->objPackage->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 'TopicLinkId': /** * Gets the value for intTopicLinkId (Not Null) * @return integer */ return $this->intTopicLinkId; case 'Name': /** * Gets the value for strName * @return string */ return $this->strName; case 'PersonId': /** * Gets the value for intPersonId * @return integer */ return $this->intPersonId; case 'LastPostDate': /** * Gets the value for dttLastPostDate * @return QDateTime */ return $this->dttLastPostDate; case 'MessageCount': /** * Gets the value for intMessageCount * @return integer */ return $this->intMessageCount; case 'ViewCount': /** * Gets the value for intViewCount * @return integer */ return $this->intViewCount; /////////////////// // Member Objects /////////////////// /////////////////// // Member Objects /////////////////// case 'TopicLink': /** * Gets the value for the TopicLink object referenced by intTopicLinkId (Not Null) * @return TopicLink */ try { if (!$this->objTopicLink && !is_null($this->intTopicLinkId)) { $this->objTopicLink = TopicLink::Load($this->intTopicLinkId); } return $this->objTopicLink; } catch (QCallerException $objExc) { $objExc->IncrementOffset(); throw $objExc; } case 'Person': /** * Gets the value for the Person object referenced by intPersonId * @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; } //////////////////////////// // 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 '_PersonAsEmail': /** * Gets the value for the private _objPersonAsEmail (Read-Only) * if set due to an expansion on the email_topic_person_assn association table * @return Person */ return $this->_objPersonAsEmail; case '_PersonAsEmailArray': /** * Gets the value for the private _objPersonAsEmailArray (Read-Only) * if set due to an ExpandAsArray on the email_topic_person_assn association table * @return Person[] */ return (array) $this->_objPersonAsEmailArray; case '_PersonAsReadOnce': /** * Gets the value for the private _objPersonAsReadOnce (Read-Only) * if set due to an expansion on the read_once_topic_person_assn association table * @return Person */ return $this->_objPersonAsReadOnce; case '_PersonAsReadOnceArray': /** * Gets the value for the private _objPersonAsReadOnceArray (Read-Only) * if set due to an ExpandAsArray on the read_once_topic_person_assn association table * @return Person[] */ return (array) $this->_objPersonAsReadOnceArray; case '_PersonAsRead': /** * Gets the value for the private _objPersonAsRead (Read-Only) * if set due to an expansion on the read_topic_person_assn association table * @return Person */ return $this->_objPersonAsRead; case '_PersonAsReadArray': /** * Gets the value for the private _objPersonAsReadArray (Read-Only) * if set due to an ExpandAsArray on the read_topic_person_assn association table * @return Person[] */ return (array) $this->_objPersonAsReadArray; case '_Message': /** * Gets the value for the private _objMessage (Read-Only) * if set due to an expansion on the message.topic_id reverse relationship * @return Message */ return $this->_objMessage; case '_MessageArray': /** * Gets the value for the private _objMessageArray (Read-Only) * if set due to an ExpandAsArray on the message.topic_id reverse relationship * @return Message[] */ return (array) $this->_objMessageArray; 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 TopicLinkMetaControl * @param integer $intId primary key value * @param QMetaControlCreateType $intCreateType rules governing TopicLink object creation - defaults to CreateOrEdit * @return TopicLinkMetaControl */ public static function Create($objParentObject, $intId = null, $intCreateType = QMetaControlCreateType::CreateOrEdit) { // Attempt to Load from PK Arguments if (strlen($intId)) { $objTopicLink = TopicLink::Load($intId); // TopicLink was found -- return it! if ($objTopicLink) { return new TopicLinkMetaControl($objParentObject, $objTopicLink); } else { if ($intCreateType != QMetaControlCreateType::CreateOnRecordNotFound) { throw new QCallerException('Could not find a TopicLink 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 TopicLinkMetaControl($objParentObject, new TopicLink()); }
/** * 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 'TopicId': /** * Gets the value for intTopicId (Not Null) * @return integer */ return $this->intTopicId; case 'TopicLinkId': /** * Gets the value for intTopicLinkId (Not Null) * @return integer */ return $this->intTopicLinkId; case 'PersonId': /** * Gets the value for intPersonId * @return integer */ return $this->intPersonId; case 'Message': /** * Gets the value for strMessage * @return string */ return $this->strMessage; case 'CompiledHtml': /** * Gets the value for strCompiledHtml * @return string */ return $this->strCompiledHtml; case 'ReplyNumber': /** * Gets the value for intReplyNumber (Not Null) * @return integer */ return $this->intReplyNumber; case 'PostDate': /** * Gets the value for dttPostDate (Not Null) * @return QDateTime */ return $this->dttPostDate; /////////////////// // Member Objects /////////////////// /////////////////// // Member Objects /////////////////// case 'Topic': /** * Gets the value for the Topic object referenced by intTopicId (Not Null) * @return Topic */ try { if (!$this->objTopic && !is_null($this->intTopicId)) { $this->objTopic = Topic::Load($this->intTopicId); } return $this->objTopic; } catch (QCallerException $objExc) { $objExc->IncrementOffset(); throw $objExc; } case 'TopicLink': /** * Gets the value for the TopicLink object referenced by intTopicLinkId (Not Null) * @return TopicLink */ try { if (!$this->objTopicLink && !is_null($this->intTopicLinkId)) { $this->objTopicLink = TopicLink::Load($this->intTopicLinkId); } return $this->objTopicLink; } catch (QCallerException $objExc) { $objExc->IncrementOffset(); throw $objExc; } case 'Person': /** * Gets the value for the Person object referenced by intPersonId * @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; } //////////////////////////// // 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; } } }
/** * This will save this object's Forum instance, * updating only the fields which have had a control created for it. */ public function SaveForum() { try { // Update any fields for controls that have been created if ($this->txtOrderNumber) { $this->objForum->OrderNumber = $this->txtOrderNumber->Text; } if ($this->txtName) { $this->objForum->Name = $this->txtName->Text; } if ($this->chkAnnounceOnlyFlag) { $this->objForum->AnnounceOnlyFlag = $this->chkAnnounceOnlyFlag->Checked; } if ($this->txtDescription) { $this->objForum->Description = $this->txtDescription->Text; } // Update any UniqueReverseReferences (if any) for controls that have been created for it if ($this->lstTopicLink) { $this->objForum->TopicLink = TopicLink::Load($this->lstTopicLink->SelectedValue); } // Save the Forum object $this->objForum->Save(); // Finally, update any ManyToManyReferences (if any) } catch (QCallerException $objExc) { $objExc->IncrementOffset(); throw $objExc; } }
/** * This will save this object's Issue instance, * updating only the fields which have had a control created for it. */ public function SaveIssue() { try { // Update any fields for controls that have been created if ($this->lstIssuePriorityType) { $this->objIssue->IssuePriorityTypeId = $this->lstIssuePriorityType->SelectedValue; } if ($this->lstIssueStatusType) { $this->objIssue->IssueStatusTypeId = $this->lstIssueStatusType->SelectedValue; } if ($this->lstIssueResolutionType) { $this->objIssue->IssueResolutionTypeId = $this->lstIssueResolutionType->SelectedValue; } if ($this->txtTitle) { $this->objIssue->Title = $this->txtTitle->Text; } if ($this->txtExampleCode) { $this->objIssue->ExampleCode = $this->txtExampleCode->Text; } if ($this->txtExampleTemplate) { $this->objIssue->ExampleTemplate = $this->txtExampleTemplate->Text; } if ($this->txtExampleData) { $this->objIssue->ExampleData = $this->txtExampleData->Text; } if ($this->txtExpectedOutput) { $this->objIssue->ExpectedOutput = $this->txtExpectedOutput->Text; } if ($this->txtActualOutput) { $this->objIssue->ActualOutput = $this->txtActualOutput->Text; } if ($this->lstPostedByPerson) { $this->objIssue->PostedByPersonId = $this->lstPostedByPerson->SelectedValue; } if ($this->lstAssignedToPerson) { $this->objIssue->AssignedToPersonId = $this->lstAssignedToPerson->SelectedValue; } if ($this->calPostDate) { $this->objIssue->PostDate = $this->calPostDate->DateTime; } if ($this->calAssignedDate) { $this->objIssue->AssignedDate = $this->calAssignedDate->DateTime; } if ($this->calDueDate) { $this->objIssue->DueDate = $this->calDueDate->DateTime; } if ($this->txtVoteCount) { $this->objIssue->VoteCount = $this->txtVoteCount->Text; } // Update any UniqueReverseReferences (if any) for controls that have been created for it if ($this->lstTopicLink) { $this->objIssue->TopicLink = TopicLink::Load($this->lstTopicLink->SelectedValue); } // Save the Issue object $this->objIssue->Save(); // Finally, update any ManyToManyReferences (if any) } catch (QCallerException $objExc) { $objExc->IncrementOffset(); throw $objExc; } }
/** * Reload this TopicLink 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 TopicLink object.'); } // Reload the Object $objReloaded = TopicLink::Load($this->intId); // Update $this's local variables to match $this->TopicLinkTypeId = $objReloaded->TopicLinkTypeId; $this->intTopicCount = $objReloaded->intTopicCount; $this->intMessageCount = $objReloaded->intMessageCount; $this->dttLastPostDate = $objReloaded->dttLastPostDate; $this->ForumId = $objReloaded->ForumId; $this->IssueId = $objReloaded->IssueId; $this->WikiItemId = $objReloaded->WikiItemId; $this->PackageId = $objReloaded->PackageId; }
/** * This will save this object's WikiItem instance, * updating only the fields which have had a control created for it. */ public function SaveWikiItem() { try { // Update any fields for controls that have been created if ($this->txtPath) { $this->objWikiItem->Path = $this->txtPath->Text; } if ($this->lstWikiItemType) { $this->objWikiItem->WikiItemTypeId = $this->lstWikiItemType->SelectedValue; } if ($this->lstEditorMinimumPersonType) { $this->objWikiItem->EditorMinimumPersonTypeId = $this->lstEditorMinimumPersonType->SelectedValue; } if ($this->txtOverrideNavbarIndex) { $this->objWikiItem->OverrideNavbarIndex = $this->txtOverrideNavbarIndex->Text; } if ($this->txtOverrideSubnavIndex) { $this->objWikiItem->OverrideSubnavIndex = $this->txtOverrideSubnavIndex->Text; } if ($this->lstCurrentWikiVersion) { $this->objWikiItem->CurrentWikiVersionId = $this->lstCurrentWikiVersion->SelectedValue; } if ($this->txtCurrentName) { $this->objWikiItem->CurrentName = $this->txtCurrentName->Text; } if ($this->lstCurrentPostedByPerson) { $this->objWikiItem->CurrentPostedByPersonId = $this->lstCurrentPostedByPerson->SelectedValue; } if ($this->calCurrentPostDate) { $this->objWikiItem->CurrentPostDate = $this->calCurrentPostDate->DateTime; } // Update any UniqueReverseReferences (if any) for controls that have been created for it if ($this->lstTopicLink) { $this->objWikiItem->TopicLink = TopicLink::Load($this->lstTopicLink->SelectedValue); } // Save the WikiItem object $this->objWikiItem->Save(); // Finally, update any ManyToManyReferences (if any) } catch (QCallerException $objExc) { $objExc->IncrementOffset(); throw $objExc; } }