/**
  * Reload this NarroProjectCategory 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 NarroProjectCategory object.');
     }
     $this->DeleteCache();
     // Reload the Object
     $objReloaded = NarroProjectCategory::Load($this->intProjectCategoryId);
     // Update $this's local variables to match
     $this->strCategoryName = $objReloaded->strCategoryName;
     $this->strCategoryDescription = $objReloaded->strCategoryDescription;
 }
 /**
  * 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 NarroProjectCategoryMetaControl
  * @param integer $intProjectCategoryId primary key value
  * @param QMetaControlCreateType $intCreateType rules governing NarroProjectCategory object creation - defaults to CreateOrEdit
  * @return NarroProjectCategoryMetaControl
  */
 public static function Create($objParentObject, $intProjectCategoryId = null, $intCreateType = QMetaControlCreateType::CreateOrEdit)
 {
     // Attempt to Load from PK Arguments
     if (strlen($intProjectCategoryId)) {
         $objNarroProjectCategory = NarroProjectCategory::Load($intProjectCategoryId);
         // NarroProjectCategory was found -- return it!
         if ($objNarroProjectCategory) {
             return new NarroProjectCategoryMetaControl($objParentObject, $objNarroProjectCategory);
         } else {
             if ($intCreateType != QMetaControlCreateType::CreateOnRecordNotFound) {
                 throw new QCallerException('Could not find a NarroProjectCategory object with PK arguments: ' . $intProjectCategoryId);
             }
         }
         // 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 NarroProjectCategoryMetaControl($objParentObject, new NarroProjectCategory());
 }
Example #3
0
 /**
  * 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 'ProjectId':
             /**
              * Gets the value for intProjectId (Read-Only PK)
              * @return integer
              */
             return $this->intProjectId;
         case 'ProjectCategoryId':
             /**
              * Gets the value for intProjectCategoryId 
              * @return integer
              */
             return $this->intProjectCategoryId;
         case 'ProjectName':
             /**
              * Gets the value for strProjectName (Unique)
              * @return string
              */
             return $this->strProjectName;
         case 'ProjectType':
             /**
              * Gets the value for intProjectType (Not Null)
              * @return integer
              */
             return $this->intProjectType;
         case 'ProjectDescription':
             /**
              * Gets the value for strProjectDescription 
              * @return string
              */
             return $this->strProjectDescription;
         case 'Data':
             /**
              * Gets the value for strData 
              * @return string
              */
             return $this->strData;
         case 'Active':
             /**
              * Gets the value for intActive (Not Null)
              * @return integer
              */
             return $this->intActive;
             ///////////////////
             // Member Objects
             ///////////////////
         ///////////////////
         // Member Objects
         ///////////////////
         case 'ProjectCategory':
             /**
              * Gets the value for the NarroProjectCategory object referenced by intProjectCategoryId 
              * @return NarroProjectCategory
              */
             try {
                 if (!$this->objProjectCategory && !is_null($this->intProjectCategoryId)) {
                     $this->objProjectCategory = NarroProjectCategory::Load($this->intProjectCategoryId);
                 }
                 return $this->objProjectCategory;
             } 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 '_NarroContextAsProject':
             /**
              * Gets the value for the private _objNarroContextAsProject (Read-Only)
              * if set due to an expansion on the narro_context.project_id reverse relationship
              * @return NarroContext
              */
             return $this->_objNarroContextAsProject;
         case '_NarroContextAsProjectArray':
             /**
              * Gets the value for the private _objNarroContextAsProjectArray (Read-Only)
              * if set due to an ExpandAsArray on the narro_context.project_id reverse relationship
              * @return NarroContext[]
              */
             return $this->_objNarroContextAsProjectArray;
         case '_NarroFileAsProject':
             /**
              * Gets the value for the private _objNarroFileAsProject (Read-Only)
              * if set due to an expansion on the narro_file.project_id reverse relationship
              * @return NarroFile
              */
             return $this->_objNarroFileAsProject;
         case '_NarroFileAsProjectArray':
             /**
              * Gets the value for the private _objNarroFileAsProjectArray (Read-Only)
              * if set due to an ExpandAsArray on the narro_file.project_id reverse relationship
              * @return NarroFile[]
              */
             return $this->_objNarroFileAsProjectArray;
         case '_NarroLogAsProject':
             /**
              * Gets the value for the private _objNarroLogAsProject (Read-Only)
              * if set due to an expansion on the narro_log.project_id reverse relationship
              * @return NarroLog
              */
             return $this->_objNarroLogAsProject;
         case '_NarroLogAsProjectArray':
             /**
              * Gets the value for the private _objNarroLogAsProjectArray (Read-Only)
              * if set due to an ExpandAsArray on the narro_log.project_id reverse relationship
              * @return NarroLog[]
              */
             return $this->_objNarroLogAsProjectArray;
         case '_NarroProjectProgressAsProject':
             /**
              * Gets the value for the private _objNarroProjectProgressAsProject (Read-Only)
              * if set due to an expansion on the narro_project_progress.project_id reverse relationship
              * @return NarroProjectProgress
              */
             return $this->_objNarroProjectProgressAsProject;
         case '_NarroProjectProgressAsProjectArray':
             /**
              * Gets the value for the private _objNarroProjectProgressAsProjectArray (Read-Only)
              * if set due to an ExpandAsArray on the narro_project_progress.project_id reverse relationship
              * @return NarroProjectProgress[]
              */
             return $this->_objNarroProjectProgressAsProjectArray;
         case '_NarroUserRoleAsProject':
             /**
              * Gets the value for the private _objNarroUserRoleAsProject (Read-Only)
              * if set due to an expansion on the narro_user_role.project_id reverse relationship
              * @return NarroUserRole
              */
             return $this->_objNarroUserRoleAsProject;
         case '_NarroUserRoleAsProjectArray':
             /**
              * Gets the value for the private _objNarroUserRoleAsProjectArray (Read-Only)
              * if set due to an ExpandAsArray on the narro_user_role.project_id reverse relationship
              * @return NarroUserRole[]
              */
             return $this->_objNarroUserRoleAsProjectArray;
         case '__Restored':
             return $this->__blnRestored;
         default:
             try {
                 return parent::__get($strName);
             } catch (QCallerException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
     }
 }