/** * Reload this ClassRegistration 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 ClassRegistration object.'); } // Reload the Object $objReloaded = ClassRegistration::Load($this->intSignupEntryId); // Update $this's local variables to match $this->SignupEntryId = $objReloaded->SignupEntryId; $this->__intSignupEntryId = $this->intSignupEntryId; $this->ClassMeetingId = $objReloaded->ClassMeetingId; $this->PersonId = $objReloaded->PersonId; $this->ClassGradeId = $objReloaded->ClassGradeId; $this->strChildcareNotes = $objReloaded->strChildcareNotes; }
/** * 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 ClassRegistrationMetaControl * @param integer $intSignupEntryId primary key value * @param QMetaControlCreateType $intCreateType rules governing ClassRegistration object creation - defaults to CreateOrEdit * @return ClassRegistrationMetaControl */ public static function Create($objParentObject, $intSignupEntryId = null, $intCreateType = QMetaControlCreateType::CreateOrEdit) { // Attempt to Load from PK Arguments if (strlen($intSignupEntryId)) { $objClassRegistration = ClassRegistration::Load($intSignupEntryId); // ClassRegistration was found -- return it! if ($objClassRegistration) { return new ClassRegistrationMetaControl($objParentObject, $objClassRegistration); } else { if ($intCreateType != QMetaControlCreateType::CreateOnRecordNotFound) { throw new QCallerException('Could not find a ClassRegistration object with PK arguments: ' . $intSignupEntryId); } } // 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 ClassRegistrationMetaControl($objParentObject, new ClassRegistration()); }
/** * 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 'ClassRegistrationId': // Gets the value for intClassRegistrationId (Not Null) // @return integer return $this->intClassRegistrationId; case 'MeetingNumber': // Gets the value for intMeetingNumber (Not Null) // @return integer return $this->intMeetingNumber; case 'PresentFlag': // Gets the value for blnPresentFlag // @return boolean return $this->blnPresentFlag; /////////////////// // Member Objects /////////////////// /////////////////// // Member Objects /////////////////// case 'ClassRegistration': // Gets the value for the ClassRegistration object referenced by intClassRegistrationId (Not Null) // @return ClassRegistration try { if (!$this->objClassRegistration && !is_null($this->intClassRegistrationId)) { $this->objClassRegistration = ClassRegistration::Load($this->intClassRegistrationId); } return $this->objClassRegistration; } 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; } } }
/** * This will save this object's SignupEntry instance, * updating only the fields which have had a control created for it. */ public function SaveSignupEntry() { try { // Update any fields for controls that have been created if ($this->lstSignupForm) { $this->objSignupEntry->SignupFormId = $this->lstSignupForm->SelectedValue; } if ($this->lstPerson) { $this->objSignupEntry->PersonId = $this->lstPerson->SelectedValue; } if ($this->lstSignupByPerson) { $this->objSignupEntry->SignupByPersonId = $this->lstSignupByPerson->SelectedValue; } if ($this->lstSignupEntryStatusType) { $this->objSignupEntry->SignupEntryStatusTypeId = $this->lstSignupEntryStatusType->SelectedValue; } if ($this->calDateCreated) { $this->objSignupEntry->DateCreated = $this->calDateCreated->DateTime; } if ($this->calDateSubmitted) { $this->objSignupEntry->DateSubmitted = $this->calDateSubmitted->DateTime; } if ($this->txtAmountTotal) { $this->objSignupEntry->AmountTotal = $this->txtAmountTotal->Text; } if ($this->txtAmountPaid) { $this->objSignupEntry->AmountPaid = $this->txtAmountPaid->Text; } if ($this->txtAmountBalance) { $this->objSignupEntry->AmountBalance = $this->txtAmountBalance->Text; } if ($this->txtInternalNotes) { $this->objSignupEntry->InternalNotes = $this->txtInternalNotes->Text; } if ($this->lstCommunicationsEntry) { $this->objSignupEntry->CommunicationsEntryId = $this->lstCommunicationsEntry->SelectedValue; } // Update any UniqueReverseReferences (if any) for controls that have been created for it if ($this->lstClassRegistration) { $this->objSignupEntry->ClassRegistration = ClassRegistration::Load($this->lstClassRegistration->SelectedValue); } // Save the SignupEntry object $this->objSignupEntry->Save(); // Finally, update any ManyToManyReferences (if any) } catch (QCallerException $objExc) { $objExc->IncrementOffset(); throw $objExc; } }