/** * Reload this CommentCategory 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 CommentCategory object.'); } // Reload the Object $objReloaded = CommentCategory::Load($this->intId); // Update $this's local variables to match $this->intOrderNumber = $objReloaded->intOrderNumber; $this->strName = $objReloaded->strName; }
/** * 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 CommentCategoryMetaControl * @param integer $intId primary key value * @param QMetaControlCreateType $intCreateType rules governing CommentCategory object creation - defaults to CreateOrEdit * @return CommentCategoryMetaControl */ public static function Create($objParentObject, $intId = null, $intCreateType = QMetaControlCreateType::CreateOrEdit) { // Attempt to Load from PK Arguments if (strlen($intId)) { $objCommentCategory = CommentCategory::Load($intId); // CommentCategory was found -- return it! if ($objCommentCategory) { return new CommentCategoryMetaControl($objParentObject, $objCommentCategory); } else { if ($intCreateType != QMetaControlCreateType::CreateOnRecordNotFound) { throw new QCallerException('Could not find a CommentCategory 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 CommentCategoryMetaControl($objParentObject, new CommentCategory()); }
/** * 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 'PersonId': // Gets the value for intPersonId (Not Null) // @return integer return $this->intPersonId; case 'PostedByLoginId': // Gets the value for intPostedByLoginId (Not Null) // @return integer return $this->intPostedByLoginId; case 'CommentPrivacyTypeId': // Gets the value for intCommentPrivacyTypeId (Not Null) // @return integer return $this->intCommentPrivacyTypeId; case 'CommentCategoryId': // Gets the value for intCommentCategoryId (Not Null) // @return integer return $this->intCommentCategoryId; case 'Comment': // Gets the value for strComment // @return string return $this->strComment; case 'DatePosted': // Gets the value for dttDatePosted (Not Null) // @return QDateTime return $this->dttDatePosted; case 'DateAction': // Gets the value for dttDateAction // @return QDateTime return $this->dttDateAction; /////////////////// // Member Objects /////////////////// /////////////////// // Member Objects /////////////////// case 'Person': // Gets the value for the Person object referenced by intPersonId (Not Null) // @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; } case 'PostedByLogin': // Gets the value for the Login object referenced by intPostedByLoginId (Not Null) // @return Login try { if (!$this->objPostedByLogin && !is_null($this->intPostedByLoginId)) { $this->objPostedByLogin = Login::Load($this->intPostedByLoginId); } return $this->objPostedByLogin; } catch (QCallerException $objExc) { $objExc->IncrementOffset(); throw $objExc; } case 'CommentCategory': // Gets the value for the CommentCategory object referenced by intCommentCategoryId (Not Null) // @return CommentCategory try { if (!$this->objCommentCategory && !is_null($this->intCommentCategoryId)) { $this->objCommentCategory = CommentCategory::Load($this->intCommentCategoryId); } return $this->objCommentCategory; } 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; } } }
public function pxyMoveUp_Click($strFormId, $strControlId, $strParameter) { $objObject = CommentCategory::Load($strParameter); $objObject->MoveUp(); $this->dtgCategories->Refresh(); }