/**
  * 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 'ManufacturerId':
             // Gets the value for intManufacturerId (Read-Only PK)
             // @return integer
             return $this->intManufacturerId;
         case 'ShortDescription':
             // Gets the value for strShortDescription (Not Null)
             // @return string
             return $this->strShortDescription;
         case 'LongDescription':
             // Gets the value for strLongDescription
             // @return string
             return $this->strLongDescription;
         case 'ImagePath':
             // Gets the value for strImagePath
             // @return string
             return $this->strImagePath;
         case 'CreatedBy':
             // Gets the value for intCreatedBy
             // @return integer
             return $this->intCreatedBy;
         case 'CreationDate':
             // Gets the value for dttCreationDate
             // @return QDateTime
             return $this->dttCreationDate;
         case 'ModifiedBy':
             // Gets the value for intModifiedBy
             // @return integer
             return $this->intModifiedBy;
         case 'ModifiedDate':
             // Gets the value for strModifiedDate (Read-Only Timestamp)
             // @return string
             return $this->strModifiedDate;
             ///////////////////
             // Member Objects
             ///////////////////
         ///////////////////
         // Member Objects
         ///////////////////
         case 'CreatedByObject':
             // Gets the value for the UserAccount object referenced by intCreatedBy
             // @return UserAccount
             try {
                 if (!$this->objCreatedByObject && !is_null($this->intCreatedBy)) {
                     $this->objCreatedByObject = UserAccount::Load($this->intCreatedBy);
                 }
                 return $this->objCreatedByObject;
             } catch (QCallerException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
         case 'ModifiedByObject':
             // Gets the value for the UserAccount object referenced by intModifiedBy
             // @return UserAccount
             try {
                 if (!$this->objModifiedByObject && !is_null($this->intModifiedBy)) {
                     $this->objModifiedByObject = UserAccount::Load($this->intModifiedBy);
                 }
                 return $this->objModifiedByObject;
             } catch (QCallerException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
         case 'ManufacturerCustomFieldHelper':
             // Gets the value for the ManufacturerCustomFieldHelper object that uniquely references this Manufacturer
             // by objManufacturerCustomFieldHelper (Unique)
             // @return ManufacturerCustomFieldHelper
             try {
                 if ($this->objManufacturerCustomFieldHelper === false) {
                     // We've attempted early binding -- and the reverse reference object does not exist
                     return null;
                 }
                 if (!$this->objManufacturerCustomFieldHelper) {
                     $this->objManufacturerCustomFieldHelper = ManufacturerCustomFieldHelper::LoadByManufacturerId($this->intManufacturerId);
                 }
                 return $this->objManufacturerCustomFieldHelper;
             } 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 '_AssetModel':
             // Gets the value for the private _objAssetModel (Read-Only)
             // if set due to an expansion on the asset_model.manufacturer_id reverse relationship
             // @return AssetModel
             return $this->_objAssetModel;
         case '_AssetModelArray':
             // Gets the value for the private _objAssetModelArray (Read-Only)
             // if set due to an ExpandAsArray on the asset_model.manufacturer_id reverse relationship
             // @return AssetModel[]
             return (array) $this->_objAssetModelArray;
         case '_InventoryModel':
             // Gets the value for the private _objInventoryModel (Read-Only)
             // if set due to an expansion on the inventory_model.manufacturer_id reverse relationship
             // @return InventoryModel
             return $this->_objInventoryModel;
         case '_InventoryModelArray':
             // Gets the value for the private _objInventoryModelArray (Read-Only)
             // if set due to an ExpandAsArray on the inventory_model.manufacturer_id reverse relationship
             // @return InventoryModel[]
             return (array) $this->_objInventoryModelArray;
         case '__Restored':
             return $this->__blnRestored;
         default:
             try {
                 return parent::__get($strName);
             } catch (QCallerException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
     }
 }
 /**
  * Main utility method to aid with data binding.  It is used by the default BindAllRows() databinder but
  * could and should be used by any custom databind methods that would be used for instances of this
  * MetaDataGrid, by simply passing in a custom QQCondition and/or QQClause. 
  *
  * If a paginator is set on this DataBinder, it will use it.  If not, then no pagination will be used.
  * It will also perform any sorting (if applicable).
  *
  * @param QQCondition $objConditions override the default condition of QQ::All() to the query, itself
  * @param QQClause[] $objOptionalClauses additional optional QQClause object or array of QQClause objects for the query		 
  * @return void
  */
 public function MetaDataBinder(QQCondition $objCondition = null, $objOptionalClauses = null)
 {
     // Setup input parameters to default values if none passed in
     if (!$objCondition) {
         $objCondition = QQ::All();
     }
     $objClauses = $objOptionalClauses ? $objOptionalClauses : array();
     // We need to first set the TotalItemCount, which will affect the calcuation of LimitClause below
     if ($this->Paginator) {
         $this->TotalItemCount = ManufacturerCustomFieldHelper::QueryCount($objCondition, $objClauses);
     }
     // If a column is selected to be sorted, and if that column has a OrderByClause set on it, then let's add
     // the OrderByClause to the $objClauses array
     if ($objClause = $this->OrderByClause) {
         array_push($objClauses, $objClause);
     }
     // Add the LimitClause information, as well
     if ($objClause = $this->LimitClause) {
         array_push($objClauses, $objClause);
     }
     // Set the DataSource to be a Query result from ManufacturerCustomFieldHelper, given the clauses above
     $this->DataSource = ManufacturerCustomFieldHelper::QueryArray($objCondition, $objClauses);
 }
 public static function GetSoapArrayFromArray($objArray)
 {
     if (!$objArray) {
         return null;
     }
     $objArrayToReturn = array();
     foreach ($objArray as $objObject) {
         array_push($objArrayToReturn, ManufacturerCustomFieldHelper::GetSoapObjectFromObject($objObject, true));
     }
     return unserialize(serialize($objArrayToReturn));
 }
 protected function UpdateManufacturerFields()
 {
     $this->objManufacturer->ShortDescription = $this->txtShortDescription->Text;
     $this->objManufacturer->LongDescription = $this->txtLongDescription->Text;
     $this->objManufacturer->ImagePath = $this->txtImagePath->Text;
     $this->objManufacturer->CreatedBy = $this->lstCreatedByObject->SelectedValue;
     $this->objManufacturer->CreationDate = $this->calCreationDate->DateTime;
     $this->objManufacturer->ModifiedBy = $this->lstModifiedByObject->SelectedValue;
     $this->objManufacturer->ManufacturerCustomFieldHelper = ManufacturerCustomFieldHelper::Load($this->lstManufacturerCustomFieldHelper->SelectedValue);
 }
 /**
  * This will save this object's Manufacturer instance,
  * updating only the fields which have had a control created for it.
  */
 public function SaveManufacturer()
 {
     try {
         // Update any fields for controls that have been created
         if ($this->txtShortDescription) {
             $this->objManufacturer->ShortDescription = $this->txtShortDescription->Text;
         }
         if ($this->txtLongDescription) {
             $this->objManufacturer->LongDescription = $this->txtLongDescription->Text;
         }
         if ($this->txtImagePath) {
             $this->objManufacturer->ImagePath = $this->txtImagePath->Text;
         }
         if ($this->lstCreatedByObject) {
             $this->objManufacturer->CreatedBy = $this->lstCreatedByObject->SelectedValue;
         }
         if ($this->calCreationDate) {
             $this->objManufacturer->CreationDate = $this->calCreationDate->DateTime;
         }
         if ($this->lstModifiedByObject) {
             $this->objManufacturer->ModifiedBy = $this->lstModifiedByObject->SelectedValue;
         }
         // Update any UniqueReverseReferences (if any) for controls that have been created for it
         if ($this->lstManufacturerCustomFieldHelper) {
             $this->objManufacturer->ManufacturerCustomFieldHelper = ManufacturerCustomFieldHelper::Load($this->lstManufacturerCustomFieldHelper->SelectedValue);
         }
         // Save the Manufacturer object
         $this->objManufacturer->Save();
         // Finally, update any ManyToManyReferences (if any)
     } 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 ManufacturerCustomFieldHelperMetaControl
  * @param integer $intManufacturerId primary key value
  * @param QMetaControlCreateType $intCreateType rules governing ManufacturerCustomFieldHelper object creation - defaults to CreateOrEdit
  * @return ManufacturerCustomFieldHelperMetaControl
  */
 public static function Create($objParentObject, $intManufacturerId = null, $intCreateType = QMetaControlCreateType::CreateOrEdit)
 {
     // Attempt to Load from PK Arguments
     if (strlen($intManufacturerId)) {
         $objManufacturerCustomFieldHelper = ManufacturerCustomFieldHelper::Load($intManufacturerId);
         // ManufacturerCustomFieldHelper was found -- return it!
         if ($objManufacturerCustomFieldHelper) {
             return new ManufacturerCustomFieldHelperMetaControl($objParentObject, $objManufacturerCustomFieldHelper);
         } else {
             if ($intCreateType != QMetaControlCreateType::CreateOnRecordNotFound) {
                 throw new QCallerException('Could not find a ManufacturerCustomFieldHelper object with PK arguments: ' . $intManufacturerId);
             }
         }
         // 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 ManufacturerCustomFieldHelperMetaControl($objParentObject, new ManufacturerCustomFieldHelper());
 }