/** * Reload this Articlecategory 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 Articlecategory object.'); } // Reload the Object $objReloaded = Articlecategory::Load($this->intId); // Update $this's local variables to match $this->strArticleType = $objReloaded->strArticleType; $this->strAmazonCode = $objReloaded->strAmazonCode; $this->strDescription = $objReloaded->strDescription; }
/** * 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 ArticlecategoryMetaControl * @param integer $intId primary key value * @param QMetaControlCreateType $intCreateType rules governing Articlecategory object creation - defaults to CreateOrEdit * @return ArticlecategoryMetaControl */ public static function Create($objParentObject, $intId = null, $intCreateType = QMetaControlCreateType::CreateOrEdit) { // Attempt to Load from PK Arguments if (strlen($intId)) { $objArticlecategory = Articlecategory::Load($intId); // Articlecategory was found -- return it! if ($objArticlecategory) { return new ArticlecategoryMetaControl($objParentObject, $objArticlecategory); } else { if ($intCreateType != QMetaControlCreateType::CreateOnRecordNotFound) { throw new QCallerException('Could not find a Articlecategory 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 ArticlecategoryMetaControl($objParentObject, new Articlecategory()); }
/** * 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 'Asin': /** * Gets the value for strAsin * @return string */ return $this->strAsin; case 'DetailPageURL': /** * Gets the value for strDetailPageURL * @return string */ return $this->strDetailPageURL; case 'Binding': /** * Gets the value for strBinding * @return string */ return $this->strBinding; case 'Title': /** * Gets the value for strTitle * @return string */ return $this->strTitle; case 'ProductGroup': /** * Gets the value for intProductGroup * @return integer */ return $this->intProductGroup; case 'ImageURL': /** * Gets the value for strImageURL * @return string */ return $this->strImageURL; /////////////////// // Member Objects /////////////////// /////////////////// // Member Objects /////////////////// case 'ProductGroupObject': /** * Gets the value for the Articlecategory object referenced by intProductGroup * @return Articlecategory */ try { if (!$this->objProductGroupObject && !is_null($this->intProductGroup)) { $this->objProductGroupObject = Articlecategory::Load($this->intProductGroup); } return $this->objProductGroupObject; } 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 '_ArticlebookAsReferenceID': /** * Gets the value for the private _objArticlebookAsReferenceID (Read-Only) * if set due to an expansion on the articlebook.ReferenceID reverse relationship * @return Articlebook */ return $this->_objArticlebookAsReferenceID; case '_ArticlebookAsReferenceIDArray': /** * Gets the value for the private _objArticlebookAsReferenceIDArray (Read-Only) * if set due to an ExpandAsArray on the articlebook.ReferenceID reverse relationship * @return Articlebook[] */ return (array) $this->_objArticlebookAsReferenceIDArray; case '_ArticlemoviesAsReferenceID': /** * Gets the value for the private _objArticlemoviesAsReferenceID (Read-Only) * if set due to an expansion on the articlemovies.ReferenceID reverse relationship * @return Articlemovies */ return $this->_objArticlemoviesAsReferenceID; case '_ArticlemoviesAsReferenceIDArray': /** * Gets the value for the private _objArticlemoviesAsReferenceIDArray (Read-Only) * if set due to an ExpandAsArray on the articlemovies.ReferenceID reverse relationship * @return Articlemovies[] */ return (array) $this->_objArticlemoviesAsReferenceIDArray; case '_ArticlemusicAsReferenceID': /** * Gets the value for the private _objArticlemusicAsReferenceID (Read-Only) * if set due to an expansion on the articlemusic.ReferenceID reverse relationship * @return Articlemusic */ return $this->_objArticlemusicAsReferenceID; case '_ArticlemusicAsReferenceIDArray': /** * Gets the value for the private _objArticlemusicAsReferenceIDArray (Read-Only) * if set due to an ExpandAsArray on the articlemusic.ReferenceID reverse relationship * @return Articlemusic[] */ return (array) $this->_objArticlemusicAsReferenceIDArray; case '__Restored': return $this->__blnRestored; default: try { return parent::__get($strName); } catch (QCallerException $objExc) { $objExc->IncrementOffset(); throw $objExc; } } }