private function getSettlementName() { $location_id = $this->location_id; $location_text = $this->location_text; if ($location_id != NULL) { $object = RealEstateAgency_Object_Settlement::loadById($this->getGlobalData(), $location_id); return $object->getObjectName(); } else { return $location_text; } }
private function edit() { $object = RealEstateAgency_Object_Settlement::loadById($this->getGlobalData(), $this->object_id); if ($object) { $this->object_id = $object->getId(); $this->object_name = $object->getObjectName(); $this->filter->setAreaId($object->getAreaId()); $this->filter->setDistrictId($object->getDistrictId()); $this->page_mode = 'edit'; // set other action now; } }
private function loadData() { $globalData = $this->getGlobalData(); $sections = $this->sections; $sectionsReady = $this->sectionsReady; if ($sectionsReady & RealEstateAgency_Const::FILTER_AREA) { // load name of this section; $object = RealEstateAgency_Object_Area::loadById($globalData, $this->area_id); if ($object) { $this->area_name = $object->getObjectName(); } } else { // load list for selection, if necessary; if ($sections & RealEstateAgency_Const::FILTER_AREA) { $this->loadAreasList(); } } if ($sectionsReady & RealEstateAgency_Const::FILTER_DISTRICT) { // load name of this section; $object = RealEstateAgency_Object_District::loadById($globalData, $this->district_id); if ($object) { $this->district_name = $object->getObjectName(); } } else { // load list for selection, if necessary; and if all previous sections are ready; if ($sections & RealEstateAgency_Const::FILTER_DISTRICT) { if ($sectionsReady & RealEstateAgency_Const::FILTER_AREA) { $this->loadAreasList(); $this->loadDistrictsList(); } } } if ($sectionsReady & RealEstateAgency_Const::FILTER_SETTLEMENT) { // load name of this section; $object = RealEstateAgency_Object_Settlement::loadById($globalData, $this->settlement_id); if ($object) { $this->settlement_name = $object->getObjectName(); } } else { // load list for selection, if necessary; and if all previous sections are ready; if ($sections & RealEstateAgency_Const::FILTER_SETTLEMENT) { if ($sectionsReady & RealEstateAgency_Const::FILTER_DISTRICT) { if ($sectionsReady & RealEstateAgency_Const::FILTER_AREA) { $this->loadAreasList(); $this->loadDistrictsList(); $this->loadSettlementsList(); } } } } }