Exemplo n.º 1
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 'SignupEntryId':
             // Gets the value for intSignupEntryId (PK)
             // @return integer
             return $this->intSignupEntryId;
         case 'ClassMeetingId':
             // Gets the value for intClassMeetingId (Not Null)
             // @return integer
             return $this->intClassMeetingId;
         case 'PersonId':
             // Gets the value for intPersonId (Not Null)
             // @return integer
             return $this->intPersonId;
         case 'ClassGradeId':
             // Gets the value for intClassGradeId
             // @return integer
             return $this->intClassGradeId;
         case 'ChildcareNotes':
             // Gets the value for strChildcareNotes
             // @return string
             return $this->strChildcareNotes;
             ///////////////////
             // Member Objects
             ///////////////////
         ///////////////////
         // Member Objects
         ///////////////////
         case 'SignupEntry':
             // Gets the value for the SignupEntry object referenced by intSignupEntryId (PK)
             // @return SignupEntry
             try {
                 if (!$this->objSignupEntry && !is_null($this->intSignupEntryId)) {
                     $this->objSignupEntry = SignupEntry::Load($this->intSignupEntryId);
                 }
                 return $this->objSignupEntry;
             } catch (QCallerException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
         case 'ClassMeeting':
             // Gets the value for the ClassMeeting object referenced by intClassMeetingId (Not Null)
             // @return ClassMeeting
             try {
                 if (!$this->objClassMeeting && !is_null($this->intClassMeetingId)) {
                     $this->objClassMeeting = ClassMeeting::Load($this->intClassMeetingId);
                 }
                 return $this->objClassMeeting;
             } catch (QCallerException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
         case 'Person':
             // Gets the value for the Person object referenced by intPersonId (Not Null)
             // @return Person
             try {
                 if (!$this->objPerson && !is_null($this->intPersonId)) {
                     $this->objPerson = Person::Load($this->intPersonId);
                 }
                 return $this->objPerson;
             } catch (QCallerException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
         case 'ClassGrade':
             // Gets the value for the ClassGrade object referenced by intClassGradeId
             // @return ClassGrade
             try {
                 if (!$this->objClassGrade && !is_null($this->intClassGradeId)) {
                     $this->objClassGrade = ClassGrade::Load($this->intClassGradeId);
                 }
                 return $this->objClassGrade;
             } 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 '_ClassAttendence':
             // Gets the value for the private _objClassAttendence (Read-Only)
             // if set due to an expansion on the class_attendence.class_registration_id reverse relationship
             // @return ClassAttendence
             return $this->_objClassAttendence;
         case '_ClassAttendenceArray':
             // Gets the value for the private _objClassAttendenceArray (Read-Only)
             // if set due to an ExpandAsArray on the class_attendence.class_registration_id reverse relationship
             // @return ClassAttendence[]
             return (array) $this->_objClassAttendenceArray;
         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 ClassMeetingMetaControl
  * @param integer $intSignupFormId primary key value
  * @param QMetaControlCreateType $intCreateType rules governing ClassMeeting object creation - defaults to CreateOrEdit
  * @return ClassMeetingMetaControl
  */
 public static function Create($objParentObject, $intSignupFormId = null, $intCreateType = QMetaControlCreateType::CreateOrEdit)
 {
     // Attempt to Load from PK Arguments
     if (strlen($intSignupFormId)) {
         $objClassMeeting = ClassMeeting::Load($intSignupFormId);
         // ClassMeeting was found -- return it!
         if ($objClassMeeting) {
             return new ClassMeetingMetaControl($objParentObject, $objClassMeeting);
         } else {
             if ($intCreateType != QMetaControlCreateType::CreateOnRecordNotFound) {
                 throw new QCallerException('Could not find a ClassMeeting object with PK arguments: ' . $intSignupFormId);
             }
         }
         // 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 ClassMeetingMetaControl($objParentObject, new ClassMeeting());
 }
Exemplo n.º 3
0
 /**
  * This will save this object's SignupForm instance,
  * updating only the fields which have had a control created for it.
  */
 public function SaveSignupForm()
 {
     try {
         // Update any fields for controls that have been created
         if ($this->lstSignupFormType) {
             $this->objSignupForm->SignupFormTypeId = $this->lstSignupFormType->SelectedValue;
         }
         if ($this->lstMinistry) {
             $this->objSignupForm->MinistryId = $this->lstMinistry->SelectedValue;
         }
         if ($this->txtName) {
             $this->objSignupForm->Name = $this->txtName->Text;
         }
         if ($this->txtToken) {
             $this->objSignupForm->Token = $this->txtToken->Text;
         }
         if ($this->chkActiveFlag) {
             $this->objSignupForm->ActiveFlag = $this->chkActiveFlag->Checked;
         }
         if ($this->chkConfidentialFlag) {
             $this->objSignupForm->ConfidentialFlag = $this->chkConfidentialFlag->Checked;
         }
         if ($this->txtDescription) {
             $this->objSignupForm->Description = $this->txtDescription->Text;
         }
         if ($this->txtInformationUrl) {
             $this->objSignupForm->InformationUrl = $this->txtInformationUrl->Text;
         }
         if ($this->txtSupportEmail) {
             $this->objSignupForm->SupportEmail = $this->txtSupportEmail->Text;
         }
         if ($this->txtEmailNotification) {
             $this->objSignupForm->EmailNotification = $this->txtEmailNotification->Text;
         }
         if ($this->chkAllowOtherFlag) {
             $this->objSignupForm->AllowOtherFlag = $this->chkAllowOtherFlag->Checked;
         }
         if ($this->chkAllowMultipleFlag) {
             $this->objSignupForm->AllowMultipleFlag = $this->chkAllowMultipleFlag->Checked;
         }
         if ($this->txtSignupLimit) {
             $this->objSignupForm->SignupLimit = $this->txtSignupLimit->Text;
         }
         if ($this->txtSignupMaleLimit) {
             $this->objSignupForm->SignupMaleLimit = $this->txtSignupMaleLimit->Text;
         }
         if ($this->txtSignupFemaleLimit) {
             $this->objSignupForm->SignupFemaleLimit = $this->txtSignupFemaleLimit->Text;
         }
         if ($this->txtFundingAccount) {
             $this->objSignupForm->FundingAccount = $this->txtFundingAccount->Text;
         }
         if ($this->lstDonationStewardshipFund) {
             $this->objSignupForm->DonationStewardshipFundId = $this->lstDonationStewardshipFund->SelectedValue;
         }
         if ($this->calDateCreated) {
             $this->objSignupForm->DateCreated = $this->calDateCreated->DateTime;
         }
         if ($this->chkLoginNotRequiredFlag) {
             $this->objSignupForm->LoginNotRequiredFlag = $this->chkLoginNotRequiredFlag->Checked;
         }
         // Update any UniqueReverseReferences (if any) for controls that have been created for it
         if ($this->lstClassMeeting) {
             $this->objSignupForm->ClassMeeting = ClassMeeting::Load($this->lstClassMeeting->SelectedValue);
         }
         if ($this->lstEventSignupForm) {
             $this->objSignupForm->EventSignupForm = EventSignupForm::Load($this->lstEventSignupForm->SelectedValue);
         }
         // Save the SignupForm object
         $this->objSignupForm->Save();
         // Finally, update any ManyToManyReferences (if any)
     } catch (QCallerException $objExc) {
         $objExc->IncrementOffset();
         throw $objExc;
     }
 }
Exemplo n.º 4
0
 /**
  * Reload this ClassMeeting 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 ClassMeeting object.');
     }
     // Reload the Object
     $objReloaded = ClassMeeting::Load($this->intSignupFormId);
     // Update $this's local variables to match
     $this->SignupFormId = $objReloaded->SignupFormId;
     $this->__intSignupFormId = $this->intSignupFormId;
     $this->ClassTermId = $objReloaded->ClassTermId;
     $this->ClassCourseId = $objReloaded->ClassCourseId;
     $this->ClassInstructorId = $objReloaded->ClassInstructorId;
     $this->dttDateStart = $objReloaded->dttDateStart;
     $this->dttDateEnd = $objReloaded->dttDateEnd;
     $this->strLocation = $objReloaded->strLocation;
     $this->intMeetingDay = $objReloaded->intMeetingDay;
     $this->intMeetingStartTime = $objReloaded->intMeetingStartTime;
     $this->intMeetingEndTime = $objReloaded->intMeetingEndTime;
 }