/** * 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 TimezoneMetaControl * @param integer $intId primary key value * @param QMetaControlCreateType $intCreateType rules governing Timezone object creation - defaults to CreateOrEdit * @return TimezoneMetaControl */ public static function Create($objParentObject, $intId = null, $intCreateType = QMetaControlCreateType::CreateOrEdit) { // Attempt to Load from PK Arguments if (strlen($intId)) { $objTimezone = Timezone::Load($intId); // Timezone was found -- return it! if ($objTimezone) { return new TimezoneMetaControl($objParentObject, $objTimezone); } else { if ($intCreateType != QMetaControlCreateType::CreateOnRecordNotFound) { throw new QCallerException('Could not find a Timezone 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 TimezoneMetaControl($objParentObject, new Timezone()); }
/** * Reload this Timezone 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 Timezone object.'); } // Reload the Object $objReloaded = Timezone::Load($this->intId); // Update $this's local variables to match $this->strName = $objReloaded->strName; }
/** * 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 'PersonTypeId': // Gets the value for intPersonTypeId (Not Null) // @return integer return $this->intPersonTypeId; case 'Username': // Gets the value for strUsername (Unique) // @return string return $this->strUsername; case 'Password': // Gets the value for strPassword // @return string return $this->strPassword; case 'FirstName': // Gets the value for strFirstName (Not Null) // @return string return $this->strFirstName; case 'LastName': // Gets the value for strLastName (Not Null) // @return string return $this->strLastName; case 'Email': // Gets the value for strEmail (Unique) // @return string return $this->strEmail; case 'DisplayName': // Gets the value for strDisplayName // @return string return $this->strDisplayName; case 'PasswordResetFlag': // Gets the value for blnPasswordResetFlag // @return boolean return $this->blnPasswordResetFlag; case 'DisplayRealNameFlag': // Gets the value for blnDisplayRealNameFlag // @return boolean return $this->blnDisplayRealNameFlag; case 'DisplayEmailFlag': // Gets the value for blnDisplayEmailFlag // @return boolean return $this->blnDisplayEmailFlag; case 'OptInFlag': // Gets the value for blnOptInFlag // @return boolean return $this->blnOptInFlag; case 'DonatedFlag': // Gets the value for blnDonatedFlag // @return boolean return $this->blnDonatedFlag; case 'Location': // Gets the value for strLocation // @return string return $this->strLocation; case 'CountryId': // Gets the value for intCountryId // @return integer return $this->intCountryId; case 'Url': // Gets the value for strUrl // @return string return $this->strUrl; case 'TimezoneId': // Gets the value for intTimezoneId // @return integer return $this->intTimezoneId; case 'RegistrationDate': // Gets the value for dttRegistrationDate (Not Null) // @return QDateTime return $this->dttRegistrationDate; /////////////////// // Member Objects /////////////////// /////////////////// // Member Objects /////////////////// case 'Country': // Gets the value for the Country object referenced by intCountryId // @return Country try { if (!$this->objCountry && !is_null($this->intCountryId)) { $this->objCountry = Country::Load($this->intCountryId); } return $this->objCountry; } catch (QCallerException $objExc) { $objExc->IncrementOffset(); throw $objExc; } case 'Timezone': // Gets the value for the Timezone object referenced by intTimezoneId // @return Timezone try { if (!$this->objTimezone && !is_null($this->intTimezoneId)) { $this->objTimezone = Timezone::Load($this->intTimezoneId); } return $this->objTimezone; } 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 '_TopicAsEmail': // Gets the value for the private _objTopicAsEmail (Read-Only) // if set due to an expansion on the email_topic_person_assn association table // @return Topic return $this->_objTopicAsEmail; case '_TopicAsEmailArray': // Gets the value for the private _objTopicAsEmailArray (Read-Only) // if set due to an ExpandAsArray on the email_topic_person_assn association table // @return Topic[] return (array) $this->_objTopicAsEmailArray; case '_TopicAsReadOnce': // Gets the value for the private _objTopicAsReadOnce (Read-Only) // if set due to an expansion on the read_once_topic_person_assn association table // @return Topic return $this->_objTopicAsReadOnce; case '_TopicAsReadOnceArray': // Gets the value for the private _objTopicAsReadOnceArray (Read-Only) // if set due to an ExpandAsArray on the read_once_topic_person_assn association table // @return Topic[] return (array) $this->_objTopicAsReadOnceArray; case '_TopicAsRead': // Gets the value for the private _objTopicAsRead (Read-Only) // if set due to an expansion on the read_topic_person_assn association table // @return Topic return $this->_objTopicAsRead; case '_TopicAsReadArray': // Gets the value for the private _objTopicAsReadArray (Read-Only) // if set due to an ExpandAsArray on the read_topic_person_assn association table // @return Topic[] return (array) $this->_objTopicAsReadArray; case '_IssueAsPostedBy': // Gets the value for the private _objIssueAsPostedBy (Read-Only) // if set due to an expansion on the issue.posted_by_person_id reverse relationship // @return Issue return $this->_objIssueAsPostedBy; case '_IssueAsPostedByArray': // Gets the value for the private _objIssueAsPostedByArray (Read-Only) // if set due to an ExpandAsArray on the issue.posted_by_person_id reverse relationship // @return Issue[] return (array) $this->_objIssueAsPostedByArray; case '_IssueAsAssignedTo': // Gets the value for the private _objIssueAsAssignedTo (Read-Only) // if set due to an expansion on the issue.assigned_to_person_id reverse relationship // @return Issue return $this->_objIssueAsAssignedTo; case '_IssueAsAssignedToArray': // Gets the value for the private _objIssueAsAssignedToArray (Read-Only) // if set due to an ExpandAsArray on the issue.assigned_to_person_id reverse relationship // @return Issue[] return (array) $this->_objIssueAsAssignedToArray; case '_IssueVote': // Gets the value for the private _objIssueVote (Read-Only) // if set due to an expansion on the issue_vote.person_id reverse relationship // @return IssueVote return $this->_objIssueVote; case '_IssueVoteArray': // Gets the value for the private _objIssueVoteArray (Read-Only) // if set due to an ExpandAsArray on the issue_vote.person_id reverse relationship // @return IssueVote[] return (array) $this->_objIssueVoteArray; case '_LoginTicket': // Gets the value for the private _objLoginTicket (Read-Only) // if set due to an expansion on the login_ticket.person_id reverse relationship // @return LoginTicket return $this->_objLoginTicket; case '_LoginTicketArray': // Gets the value for the private _objLoginTicketArray (Read-Only) // if set due to an ExpandAsArray on the login_ticket.person_id reverse relationship // @return LoginTicket[] return (array) $this->_objLoginTicketArray; case '_Message': // Gets the value for the private _objMessage (Read-Only) // if set due to an expansion on the message.person_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.person_id reverse relationship // @return Message[] return (array) $this->_objMessageArray; case '_PackageAsLastPostedBy': // Gets the value for the private _objPackageAsLastPostedBy (Read-Only) // if set due to an expansion on the package.last_posted_by_person_id reverse relationship // @return Package return $this->_objPackageAsLastPostedBy; case '_PackageAsLastPostedByArray': // Gets the value for the private _objPackageAsLastPostedByArray (Read-Only) // if set due to an ExpandAsArray on the package.last_posted_by_person_id reverse relationship // @return Package[] return (array) $this->_objPackageAsLastPostedByArray; case '_PackageContribution': // Gets the value for the private _objPackageContribution (Read-Only) // if set due to an expansion on the package_contribution.person_id reverse relationship // @return PackageContribution return $this->_objPackageContribution; case '_PackageContributionArray': // Gets the value for the private _objPackageContributionArray (Read-Only) // if set due to an ExpandAsArray on the package_contribution.person_id reverse relationship // @return PackageContribution[] return (array) $this->_objPackageContributionArray; case '_ShowcaseItem': // Gets the value for the private _objShowcaseItem (Read-Only) // if set due to an expansion on the showcase_item.person_id reverse relationship // @return ShowcaseItem return $this->_objShowcaseItem; case '_ShowcaseItemArray': // Gets the value for the private _objShowcaseItemArray (Read-Only) // if set due to an ExpandAsArray on the showcase_item.person_id reverse relationship // @return ShowcaseItem[] return (array) $this->_objShowcaseItemArray; case '_Topic': // Gets the value for the private _objTopic (Read-Only) // if set due to an expansion on the topic.person_id reverse relationship // @return Topic return $this->_objTopic; case '_TopicArray': // Gets the value for the private _objTopicArray (Read-Only) // if set due to an ExpandAsArray on the topic.person_id reverse relationship // @return Topic[] return (array) $this->_objTopicArray; case '_WikiItemAsCurrentPostedBy': // Gets the value for the private _objWikiItemAsCurrentPostedBy (Read-Only) // if set due to an expansion on the wiki_item.current_posted_by_person_id reverse relationship // @return WikiItem return $this->_objWikiItemAsCurrentPostedBy; case '_WikiItemAsCurrentPostedByArray': // Gets the value for the private _objWikiItemAsCurrentPostedByArray (Read-Only) // if set due to an ExpandAsArray on the wiki_item.current_posted_by_person_id reverse relationship // @return WikiItem[] return (array) $this->_objWikiItemAsCurrentPostedByArray; case '_WikiVersionAsPostedBy': // Gets the value for the private _objWikiVersionAsPostedBy (Read-Only) // if set due to an expansion on the wiki_version.posted_by_person_id reverse relationship // @return WikiVersion return $this->_objWikiVersionAsPostedBy; case '_WikiVersionAsPostedByArray': // Gets the value for the private _objWikiVersionAsPostedByArray (Read-Only) // if set due to an ExpandAsArray on the wiki_version.posted_by_person_id reverse relationship // @return WikiVersion[] return (array) $this->_objWikiVersionAsPostedByArray; case '__Restored': return $this->__blnRestored; default: try { return parent::__get($strName); } catch (QCallerException $objExc) { $objExc->IncrementOffset(); throw $objExc; } } }