private function completeFillByArray($array)
 {
     $result = array();
     $globalData = $this->getGlobalData();
     // echo "<hr /><pre> HERE ".var_dump ($objectsOfArea)."</pre> <hr/>";
     // echo "start";
     // RealEstateAgency_Object_Cache
     foreach ($array as $index => $hash) {
         $object = new RealEstateAgency_Object_District();
         $object->setGlobalData($globalData);
         // echo "<hr /><pre> HERE ".var_dump ($hash)."</pre> <hr/>";
         // echo get_class($object);
         $object->completeFillByArray($hash);
         $result[] = $object;
     }
     // echo "D-FOUND[".count($result)."]";
     return $result;
 }
 private function insert()
 {
     $object_name = $this->object_name;
     $area_id = $this->filter->getAreaId();
     $object = new RealEstateAgency_Object_District();
     $object->setGlobalData($this->getGlobalData());
     $object->setObjectName($object_name);
     $object->setAreaId($area_id);
     $result = $object->insert();
     if ($result == RealEstateAgency_Const::ALREADY_SAVED) {
         $this->already_saved = true;
     }
 }
 public static function loadByNameAndAreaId($globalData, $object_name, $area_id)
 {
     if ($object_name == NULL || $object_name == '') {
         return NULL;
     }
     $validatorChain = new Zend_Validate();
     $validatorChain->addValidator(new Zend_Validate_Int());
     if (!$validatorChain->isValid($area_id)) {
         return NULL;
     }
     $db = $globalData->takeConnection();
     $table = new RealEstateAgency_Database_District_Table(array('db' => $db));
     $where = array($db->quoteInto('obj_name = ?', $object_name), $db->quoteInto('area = ?', $area_id));
     // RealEstateAgency_Util::printTestString('WHERE: ['.$where.']'); // test string;
     $rowset = $table->fetchAll($where);
     $row = $rowset->current();
     if ($row) {
         $new_object = new RealEstateAgency_Object_District();
         $new_object->setGlobalData($globalData);
         $new_object->fillByZendRow($row);
         return $new_object;
     } else {
         return NULL;
     }
 }