protected function Form_Create() { $this->objLocation = GrowthGroupLocation::Load(QApplication::PathInfo(0)); if (!$this->objLocation) { $this->objLocation = GrowthGroupLocation::Load(2); } $this->dtrGrowthGroups = new QDataRepeater($this, 'dtrgg'); $this->dtrGrowthGroups->Template = dirname(__FILE__) . '/dtrGrowthGroups.tpl.php'; $this->dtrGrowthGroups->SetDataBinder('dtrGrowthGroups_Bind'); $this->pnlNone = new QPanel($this, 'pnlnone'); $this->pnlNone->Text = 'No results found. Please use a less restrictive filter.'; $this->intMarkerArray = array(); $intMarkerNumber = 0; // Filter Out "inactive" groups //foreach ($this->objLocation->GetGrowthGroupArray(QQ::Equal(QQN::GrowthGroup()->Group->ActiveFlag, true), //QQ::Clause(QQ::OrderBy(QQN::GrowthGroup()->Group->Name))) as $objGroup) { foreach ($this->objLocation->GetGrowthGroupArray(QQ::OrderBy(QQN::GrowthGroup()->Group->Name)) as $objGroup) { if ($objGroup->Group->ActiveFlag == true) { $intMarkerNumber++; $this->intMarkerArray[$objGroup->GroupId] = $intMarkerNumber; } } $this->lstDays = new QListBox($this); $this->lstDays->AddItem('- View All Days -', null); $this->lstDays->AddAction(new QChangeEvent(), new QAjaxAction('dtrGrowthGroups_Bind')); foreach (GrowthGroupDayType::$NameArray as $intId => $strName) { $this->lstDays->AddItem($strName, $intId); } $this->lstTypes = new QListBox($this); $this->lstTypes->AddItem('- View All Types -', null); $this->lstTypes->AddAction(new QChangeEvent(), new QAjaxAction('dtrGrowthGroups_Bind')); foreach (GrowthGroupStructure::LoadAll(QQ::OrderBy(QQN::GrowthGroupStructure()->Name)) as $objStructure) { $this->lstTypes->AddItem($objStructure->Name, $objStructure->Id); } }
/** * Reload this GrowthGroupLocation 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 GrowthGroupLocation object.'); } // Reload the Object $objReloaded = GrowthGroupLocation::Load($this->intId); // Update $this's local variables to match $this->strLocation = $objReloaded->strLocation; $this->fltLongitude = $objReloaded->fltLongitude; $this->fltLatitude = $objReloaded->fltLatitude; $this->intZoom = $objReloaded->intZoom; }
/** * 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 'GroupId': // Gets the value for intGroupId (PK) // @return integer return $this->intGroupId; case 'GrowthGroupLocationId': // Gets the value for intGrowthGroupLocationId (Not Null) // @return integer return $this->intGrowthGroupLocationId; case 'GrowthGroupDayTypeId': // Gets the value for intGrowthGroupDayTypeId // @return integer return $this->intGrowthGroupDayTypeId; case 'MeetingBitmap': // Gets the value for intMeetingBitmap // @return integer return $this->intMeetingBitmap; case 'StartTime': // Gets the value for intStartTime // @return integer return $this->intStartTime; case 'EndTime': // Gets the value for intEndTime // @return integer return $this->intEndTime; case 'Address1': // Gets the value for strAddress1 // @return string return $this->strAddress1; case 'Address2': // Gets the value for strAddress2 // @return string return $this->strAddress2; case 'CrossStreet1': // Gets the value for strCrossStreet1 // @return string return $this->strCrossStreet1; case 'CrossStreet2': // Gets the value for strCrossStreet2 // @return string return $this->strCrossStreet2; case 'ZipCode': // Gets the value for strZipCode // @return string return $this->strZipCode; case 'Longitude': // Gets the value for fltLongitude // @return double return $this->fltLongitude; case 'Latitude': // Gets the value for fltLatitude // @return double return $this->fltLatitude; case 'Accuracy': // Gets the value for intAccuracy // @return integer return $this->intAccuracy; case 'Description': // Gets the value for strDescription // @return string return $this->strDescription; /////////////////// // Member Objects /////////////////// /////////////////// // Member Objects /////////////////// case 'Group': // Gets the value for the Group object referenced by intGroupId (PK) // @return Group try { if (!$this->objGroup && !is_null($this->intGroupId)) { $this->objGroup = Group::Load($this->intGroupId); } return $this->objGroup; } catch (QCallerException $objExc) { $objExc->IncrementOffset(); throw $objExc; } case 'GrowthGroupLocation': // Gets the value for the GrowthGroupLocation object referenced by intGrowthGroupLocationId (Not Null) // @return GrowthGroupLocation try { if (!$this->objGrowthGroupLocation && !is_null($this->intGrowthGroupLocationId)) { $this->objGrowthGroupLocation = GrowthGroupLocation::Load($this->intGrowthGroupLocationId); } return $this->objGrowthGroupLocation; } 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 '_GrowthGroupStructure': // Gets the value for the private _objGrowthGroupStructure (Read-Only) // if set due to an expansion on the growthgroupstructure_growthgroup_assn association table // @return GrowthGroupStructure return $this->_objGrowthGroupStructure; case '_GrowthGroupStructureArray': // Gets the value for the private _objGrowthGroupStructureArray (Read-Only) // if set due to an ExpandAsArray on the growthgroupstructure_growthgroup_assn association table // @return GrowthGroupStructure[] return (array) $this->_objGrowthGroupStructureArray; case '__Restored': return $this->__blnRestored; default: try { return parent::__get($strName); } catch (QCallerException $objExc) { $objExc->IncrementOffset(); throw $objExc; } } }
public function RenderLocationRegion(GrowthGroup $objGrowthGroup) { return GrowthGroupLocation::Load($objGrowthGroup->GrowthGroupLocationId)->Location; }
/** * 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 GrowthGroupLocationMetaControl * @param integer $intId primary key value * @param QMetaControlCreateType $intCreateType rules governing GrowthGroupLocation object creation - defaults to CreateOrEdit * @return GrowthGroupLocationMetaControl */ public static function Create($objParentObject, $intId = null, $intCreateType = QMetaControlCreateType::CreateOrEdit) { // Attempt to Load from PK Arguments if (strlen($intId)) { $objGrowthGroupLocation = GrowthGroupLocation::Load($intId); // GrowthGroupLocation was found -- return it! if ($objGrowthGroupLocation) { return new GrowthGroupLocationMetaControl($objParentObject, $objGrowthGroupLocation); } else { if ($intCreateType != QMetaControlCreateType::CreateOnRecordNotFound) { throw new QCallerException('Could not find a GrowthGroupLocation 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 GrowthGroupLocationMetaControl($objParentObject, new GrowthGroupLocation()); }