Ejemplo n.º 1
0
 /**
  * Reload this ParentPagerPeriod 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 ParentPagerPeriod object.');
     }
     // Reload the Object
     $objReloaded = ParentPagerPeriod::Load($this->intId);
     // Update $this's local variables to match
     $this->intServerIdentifier = $objReloaded->intServerIdentifier;
     $this->strName = $objReloaded->strName;
 }
Ejemplo n.º 2
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 'Id':
             // Gets the value for intId (Read-Only PK)
             // @return integer
             return $this->intId;
         case 'ServerIdentifier':
             // Gets the value for intServerIdentifier (Unique)
             // @return integer
             return $this->intServerIdentifier;
         case 'ParentPagerIndividualId':
             // Gets the value for intParentPagerIndividualId (Not Null)
             // @return integer
             return $this->intParentPagerIndividualId;
         case 'ParentPagerStationId':
             // Gets the value for intParentPagerStationId
             // @return integer
             return $this->intParentPagerStationId;
         case 'ParentPagerPeriodId':
             // Gets the value for intParentPagerPeriodId
             // @return integer
             return $this->intParentPagerPeriodId;
         case 'DropoffByParentPagerIndividualId':
             // Gets the value for intDropoffByParentPagerIndividualId
             // @return integer
             return $this->intDropoffByParentPagerIndividualId;
         case 'PickupByParentPagerIndividualId':
             // Gets the value for intPickupByParentPagerIndividualId
             // @return integer
             return $this->intPickupByParentPagerIndividualId;
         case 'DateIn':
             // Gets the value for dttDateIn (Not Null)
             // @return QDateTime
             return $this->dttDateIn;
         case 'DateOut':
             // Gets the value for dttDateOut (Not Null)
             // @return QDateTime
             return $this->dttDateOut;
             ///////////////////
             // Member Objects
             ///////////////////
         ///////////////////
         // Member Objects
         ///////////////////
         case 'ParentPagerIndividual':
             // Gets the value for the ParentPagerIndividual object referenced by intParentPagerIndividualId (Not Null)
             // @return ParentPagerIndividual
             try {
                 if (!$this->objParentPagerIndividual && !is_null($this->intParentPagerIndividualId)) {
                     $this->objParentPagerIndividual = ParentPagerIndividual::Load($this->intParentPagerIndividualId);
                 }
                 return $this->objParentPagerIndividual;
             } catch (QCallerException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
         case 'ParentPagerStation':
             // Gets the value for the ParentPagerStation object referenced by intParentPagerStationId
             // @return ParentPagerStation
             try {
                 if (!$this->objParentPagerStation && !is_null($this->intParentPagerStationId)) {
                     $this->objParentPagerStation = ParentPagerStation::Load($this->intParentPagerStationId);
                 }
                 return $this->objParentPagerStation;
             } catch (QCallerException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
         case 'ParentPagerPeriod':
             // Gets the value for the ParentPagerPeriod object referenced by intParentPagerPeriodId
             // @return ParentPagerPeriod
             try {
                 if (!$this->objParentPagerPeriod && !is_null($this->intParentPagerPeriodId)) {
                     $this->objParentPagerPeriod = ParentPagerPeriod::Load($this->intParentPagerPeriodId);
                 }
                 return $this->objParentPagerPeriod;
             } catch (QCallerException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
         case 'DropoffByParentPagerIndividual':
             // Gets the value for the ParentPagerIndividual object referenced by intDropoffByParentPagerIndividualId
             // @return ParentPagerIndividual
             try {
                 if (!$this->objDropoffByParentPagerIndividual && !is_null($this->intDropoffByParentPagerIndividualId)) {
                     $this->objDropoffByParentPagerIndividual = ParentPagerIndividual::Load($this->intDropoffByParentPagerIndividualId);
                 }
                 return $this->objDropoffByParentPagerIndividual;
             } catch (QCallerException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
         case 'PickupByParentPagerIndividual':
             // Gets the value for the ParentPagerIndividual object referenced by intPickupByParentPagerIndividualId
             // @return ParentPagerIndividual
             try {
                 if (!$this->objPickupByParentPagerIndividual && !is_null($this->intPickupByParentPagerIndividualId)) {
                     $this->objPickupByParentPagerIndividual = ParentPagerIndividual::Load($this->intPickupByParentPagerIndividualId);
                 }
                 return $this->objPickupByParentPagerIndividual;
             } 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;
             }
     }
 }
 /**
  * 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 ParentPagerPeriodMetaControl
  * @param integer $intId primary key value
  * @param QMetaControlCreateType $intCreateType rules governing ParentPagerPeriod object creation - defaults to CreateOrEdit
  * @return ParentPagerPeriodMetaControl
  */
 public static function Create($objParentObject, $intId = null, $intCreateType = QMetaControlCreateType::CreateOrEdit)
 {
     // Attempt to Load from PK Arguments
     if (strlen($intId)) {
         $objParentPagerPeriod = ParentPagerPeriod::Load($intId);
         // ParentPagerPeriod was found -- return it!
         if ($objParentPagerPeriod) {
             return new ParentPagerPeriodMetaControl($objParentObject, $objParentPagerPeriod);
         } else {
             if ($intCreateType != QMetaControlCreateType::CreateOnRecordNotFound) {
                 throw new QCallerException('Could not find a ParentPagerPeriod 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 ParentPagerPeriodMetaControl($objParentObject, new ParentPagerPeriod());
 }