Beispiel #1
0
 /**
  * Reload this ClassCourse 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 ClassCourse object.');
     }
     // Reload the Object
     $objReloaded = ClassCourse::Load($this->intId);
     // Update $this's local variables to match
     $this->strCode = $objReloaded->strCode;
     $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 ClassCourseMetaControl
  * @param integer $intId primary key value
  * @param QMetaControlCreateType $intCreateType rules governing ClassCourse object creation - defaults to CreateOrEdit
  * @return ClassCourseMetaControl
  */
 public static function Create($objParentObject, $intId = null, $intCreateType = QMetaControlCreateType::CreateOrEdit)
 {
     // Attempt to Load from PK Arguments
     if (strlen($intId)) {
         $objClassCourse = ClassCourse::Load($intId);
         // ClassCourse was found -- return it!
         if ($objClassCourse) {
             return new ClassCourseMetaControl($objParentObject, $objClassCourse);
         } else {
             if ($intCreateType != QMetaControlCreateType::CreateOnRecordNotFound) {
                 throw new QCallerException('Could not find a ClassCourse 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 ClassCourseMetaControl($objParentObject, new ClassCourse());
 }
Beispiel #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 'SignupFormId':
             // Gets the value for intSignupFormId (PK)
             // @return integer
             return $this->intSignupFormId;
         case 'ClassTermId':
             // Gets the value for intClassTermId (Not Null)
             // @return integer
             return $this->intClassTermId;
         case 'ClassCourseId':
             // Gets the value for intClassCourseId (Not Null)
             // @return integer
             return $this->intClassCourseId;
         case 'ClassInstructorId':
             // Gets the value for intClassInstructorId (Not Null)
             // @return integer
             return $this->intClassInstructorId;
         case 'DateStart':
             // Gets the value for dttDateStart (Not Null)
             // @return QDateTime
             return $this->dttDateStart;
         case 'DateEnd':
             // Gets the value for dttDateEnd (Not Null)
             // @return QDateTime
             return $this->dttDateEnd;
         case 'Location':
             // Gets the value for strLocation
             // @return string
             return $this->strLocation;
         case 'MeetingDay':
             // Gets the value for intMeetingDay
             // @return integer
             return $this->intMeetingDay;
         case 'MeetingStartTime':
             // Gets the value for intMeetingStartTime
             // @return integer
             return $this->intMeetingStartTime;
         case 'MeetingEndTime':
             // Gets the value for intMeetingEndTime
             // @return integer
             return $this->intMeetingEndTime;
             ///////////////////
             // Member Objects
             ///////////////////
         ///////////////////
         // Member Objects
         ///////////////////
         case 'SignupForm':
             // Gets the value for the SignupForm object referenced by intSignupFormId (PK)
             // @return SignupForm
             try {
                 if (!$this->objSignupForm && !is_null($this->intSignupFormId)) {
                     $this->objSignupForm = SignupForm::Load($this->intSignupFormId);
                 }
                 return $this->objSignupForm;
             } catch (QCallerException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
         case 'ClassTerm':
             // Gets the value for the ClassTerm object referenced by intClassTermId (Not Null)
             // @return ClassTerm
             try {
                 if (!$this->objClassTerm && !is_null($this->intClassTermId)) {
                     $this->objClassTerm = ClassTerm::Load($this->intClassTermId);
                 }
                 return $this->objClassTerm;
             } catch (QCallerException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
         case 'ClassCourse':
             // Gets the value for the ClassCourse object referenced by intClassCourseId (Not Null)
             // @return ClassCourse
             try {
                 if (!$this->objClassCourse && !is_null($this->intClassCourseId)) {
                     $this->objClassCourse = ClassCourse::Load($this->intClassCourseId);
                 }
                 return $this->objClassCourse;
             } catch (QCallerException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
         case 'ClassInstructor':
             // Gets the value for the ClassInstructor object referenced by intClassInstructorId (Not Null)
             // @return ClassInstructor
             try {
                 if (!$this->objClassInstructor && !is_null($this->intClassInstructorId)) {
                     $this->objClassInstructor = ClassInstructor::Load($this->intClassInstructorId);
                 }
                 return $this->objClassInstructor;
             } 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 '_ClassRegistration':
             // Gets the value for the private _objClassRegistration (Read-Only)
             // if set due to an expansion on the class_registration.class_meeting_id reverse relationship
             // @return ClassRegistration
             return $this->_objClassRegistration;
         case '_ClassRegistrationArray':
             // Gets the value for the private _objClassRegistrationArray (Read-Only)
             // if set due to an ExpandAsArray on the class_registration.class_meeting_id reverse relationship
             // @return ClassRegistration[]
             return (array) $this->_objClassRegistrationArray;
         case '__Restored':
             return $this->__blnRestored;
         default:
             try {
                 return parent::__get($strName);
             } catch (QCallerException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
     }
 }