/** * Reload this SourceList 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 SourceList object.'); } // Reload the Object $objReloaded = SourceList::Load($this->intId); // Update $this's local variables to match $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 SourceListMetaControl * @param integer $intId primary key value * @param QMetaControlCreateType $intCreateType rules governing SourceList object creation - defaults to CreateOrEdit * @return SourceListMetaControl */ public static function Create($objParentObject, $intId = null, $intCreateType = QMetaControlCreateType::CreateOrEdit) { // Attempt to Load from PK Arguments if (strlen($intId)) { $objSourceList = SourceList::Load($intId); // SourceList was found -- return it! if ($objSourceList) { return new SourceListMetaControl($objParentObject, $objSourceList); } else { if ($intCreateType != QMetaControlCreateType::CreateOnRecordNotFound) { throw new QCallerException('Could not find a SourceList 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 SourceListMetaControl($objParentObject, new SourceList()); }
public function RenderSource(GroupRegistrations $objGroupRegistration) { return SourceList::Load($objGroupRegistration->SourceListId)->Name; }
/** * 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 'SourceListId': // Gets the value for intSourceListId (Not Null) // @return integer return $this->intSourceListId; case 'DateReceived': // Gets the value for dttDateReceived // @return QDateTime return $this->dttDateReceived; case 'FirstName': // Gets the value for strFirstName // @return string return $this->strFirstName; case 'LastName': // Gets the value for strLastName // @return string return $this->strLastName; case 'Gender': // Gets the value for strGender // @return string return $this->strGender; case 'Address': // Gets the value for strAddress // @return string return $this->strAddress; case 'Phone': // Gets the value for strPhone // @return string return $this->strPhone; case 'Email': // Gets the value for strEmail // @return string return $this->strEmail; case 'Comments': // Gets the value for strComments // @return string return $this->strComments; case 'GroupRoleId': // Gets the value for intGroupRoleId // @return integer return $this->intGroupRoleId; case 'PreferredLocation1': // Gets the value for strPreferredLocation1 // @return string return $this->strPreferredLocation1; case 'PreferredLocation2': // Gets the value for strPreferredLocation2 // @return string return $this->strPreferredLocation2; case 'City': // Gets the value for strCity // @return string return $this->strCity; case 'Zipcode': // Gets the value for strZipcode // @return string return $this->strZipcode; case 'GroupDay': // Gets the value for strGroupDay // @return string return $this->strGroupDay; case 'GroupsPlaced': // Gets the value for strGroupsPlaced // @return string return $this->strGroupsPlaced; case 'DateProcessed': // Gets the value for dttDateProcessed // @return QDateTime return $this->dttDateProcessed; case 'ProcessedFlag': // Gets the value for blnProcessedFlag // @return boolean return $this->blnProcessedFlag; /////////////////// // Member Objects /////////////////// /////////////////// // Member Objects /////////////////// case 'SourceList': // Gets the value for the SourceList object referenced by intSourceListId (Not Null) // @return SourceList try { if (!$this->objSourceList && !is_null($this->intSourceListId)) { $this->objSourceList = SourceList::Load($this->intSourceListId); } return $this->objSourceList; } catch (QCallerException $objExc) { $objExc->IncrementOffset(); throw $objExc; } case 'GroupRole': // Gets the value for the GroupRole object referenced by intGroupRoleId // @return GroupRole try { if (!$this->objGroupRole && !is_null($this->intGroupRoleId)) { $this->objGroupRole = GroupRole::Load($this->intGroupRoleId); } return $this->objGroupRole; } 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 '_GrowthGroupStructureAsGroupstructure': // Gets the value for the private _objGrowthGroupStructureAsGroupstructure (Read-Only) // if set due to an expansion on the groupregistrations_groupstructure_assn association table // @return GrowthGroupStructure return $this->_objGrowthGroupStructureAsGroupstructure; case '_GrowthGroupStructureAsGroupstructureArray': // Gets the value for the private _objGrowthGroupStructureAsGroupstructureArray (Read-Only) // if set due to an ExpandAsArray on the groupregistrations_groupstructure_assn association table // @return GrowthGroupStructure[] return (array) $this->_objGrowthGroupStructureAsGroupstructureArray; case '__Restored': return $this->__blnRestored; default: try { return parent::__get($strName); } catch (QCallerException $objExc) { $objExc->IncrementOffset(); throw $objExc; } } }
print EscapeCsv($objGroupRegistrant->PreferredLocation1); print ","; print EscapeCsv($objGroupRegistrant->PreferredLocation2); print ","; print EscapeCsv($objGroupRegistrant->GroupRole->Name); print ","; $strReturn = ''; foreach (GrowthGroupStructure::LoadAll() as $objGrowthGroupStructure) { if ($objGroupRegistrant->IsGrowthGroupStructureAsGroupstructureAssociated($objGrowthGroupStructure)) { $strReturn .= $objGrowthGroupStructure->Name . ', '; } } $strReturn = substr($strReturn, 0, strlen($strReturn) - 2); print EscapeCsv($strReturn); print ","; print EscapeCsv($objGroupRegistrant->GroupDay); print ","; print EscapeCsv(SourceList::Load($objGroupRegistrant->SourceListId)->Name); print ","; if ($objGroupRegistrant->ProcessedFlag) { print 'Yes'; } else { print 'No'; } print ","; print EscapeCsv($objGroupRegistrant->GroupsPlaced); print ","; print EscapeCsv($objGroupRegistrant->DateProcessed); print ","; print "\r\n"; }