/**
  * 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 'IssueFieldId':
             // Gets the value for intIssueFieldId (Not Null)
             // @return integer
             return $this->intIssueFieldId;
         case 'Name':
             // Gets the value for strName (Not Null)
             // @return string
             return $this->strName;
         case 'Token':
             // Gets the value for strToken (Not Null)
             // @return string
             return $this->strToken;
         case 'OrderNumber':
             // Gets the value for intOrderNumber
             // @return integer
             return $this->intOrderNumber;
         case 'ActiveFlag':
             // Gets the value for blnActiveFlag
             // @return boolean
             return $this->blnActiveFlag;
             ///////////////////
             // Member Objects
             ///////////////////
         ///////////////////
         // Member Objects
         ///////////////////
         case 'IssueField':
             // Gets the value for the IssueField object referenced by intIssueFieldId (Not Null)
             // @return IssueField
             try {
                 if (!$this->objIssueField && !is_null($this->intIssueFieldId)) {
                     $this->objIssueField = IssueField::Load($this->intIssueFieldId);
                 }
                 return $this->objIssueField;
             } 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 '_IssueFieldValue':
             // Gets the value for the private _objIssueFieldValue (Read-Only)
             // if set due to an expansion on the issue_field_value.issue_field_option_id reverse relationship
             // @return IssueFieldValue
             return $this->_objIssueFieldValue;
         case '_IssueFieldValueArray':
             // Gets the value for the private _objIssueFieldValueArray (Read-Only)
             // if set due to an ExpandAsArray on the issue_field_value.issue_field_option_id reverse relationship
             // @return IssueFieldValue[]
             return (array) $this->_objIssueFieldValueArray;
         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 IssueFieldMetaControl
  * @param integer $intId primary key value
  * @param QMetaControlCreateType $intCreateType rules governing IssueField object creation - defaults to CreateOrEdit
  * @return IssueFieldMetaControl
  */
 public static function Create($objParentObject, $intId = null, $intCreateType = QMetaControlCreateType::CreateOrEdit)
 {
     // Attempt to Load from PK Arguments
     if (strlen($intId)) {
         $objIssueField = IssueField::Load($intId);
         // IssueField was found -- return it!
         if ($objIssueField) {
             return new IssueFieldMetaControl($objParentObject, $objIssueField);
         } else {
             if ($intCreateType != QMetaControlCreateType::CreateOnRecordNotFound) {
                 throw new QCallerException('Could not find a IssueField 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 IssueFieldMetaControl($objParentObject, new IssueField());
 }
 /**
  * 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 'IssueId':
             // Gets the value for intIssueId (Not Null)
             // @return integer
             return $this->intIssueId;
         case 'IssueFieldId':
             // Gets the value for intIssueFieldId (Not Null)
             // @return integer
             return $this->intIssueFieldId;
         case 'IssueFieldOptionId':
             // Gets the value for intIssueFieldOptionId (Not Null)
             // @return integer
             return $this->intIssueFieldOptionId;
             ///////////////////
             // Member Objects
             ///////////////////
         ///////////////////
         // Member Objects
         ///////////////////
         case 'Issue':
             // Gets the value for the Issue object referenced by intIssueId (Not Null)
             // @return Issue
             try {
                 if (!$this->objIssue && !is_null($this->intIssueId)) {
                     $this->objIssue = Issue::Load($this->intIssueId);
                 }
                 return $this->objIssue;
             } catch (QCallerException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
         case 'IssueField':
             // Gets the value for the IssueField object referenced by intIssueFieldId (Not Null)
             // @return IssueField
             try {
                 if (!$this->objIssueField && !is_null($this->intIssueFieldId)) {
                     $this->objIssueField = IssueField::Load($this->intIssueFieldId);
                 }
                 return $this->objIssueField;
             } catch (QCallerException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
         case 'IssueFieldOption':
             // Gets the value for the IssueFieldOption object referenced by intIssueFieldOptionId (Not Null)
             // @return IssueFieldOption
             try {
                 if (!$this->objIssueFieldOption && !is_null($this->intIssueFieldOptionId)) {
                     $this->objIssueFieldOption = IssueFieldOption::Load($this->intIssueFieldOptionId);
                 }
                 return $this->objIssueFieldOption;
             } 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;
             }
     }
 }
Esempio n. 4
0
 protected function lstField_Save(QListBox $lstField)
 {
     if ($lstField->SelectedValue) {
         // Did the user select "OTHER"?
         if ($lstField->SelectedValue == -1) {
             // Yes -- we need to create the new IssueFieldOption
             $objIssueField = IssueField::Load($lstField->ActionParameter);
             $objIssueFieldOption = $objIssueField->CreateNewIssueFieldOption($this->txtMutableFields[$lstField->ActionParameter]->Text);
         } else {
             // No -- let's use theexisting IssueFieldOption
             $objIssueFieldOption = IssueFieldOption::Load($lstField->SelectedValue);
         }
         // Now let's set it to the Issue!
         $this->mctIssue->Issue->SetFieldOption($objIssueFieldOption);
     }
 }
 /**
  * Reload this IssueField 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 IssueField object.');
     }
     // Reload the Object
     $objReloaded = IssueField::Load($this->intId);
     // Update $this's local variables to match
     $this->strName = $objReloaded->strName;
     $this->strToken = $objReloaded->strToken;
     $this->intOrderNumber = $objReloaded->intOrderNumber;
     $this->blnRequiredFlag = $objReloaded->blnRequiredFlag;
     $this->blnMutableFlag = $objReloaded->blnMutableFlag;
     $this->blnActiveFlag = $objReloaded->blnActiveFlag;
 }