/**
  * @author Euler Nunez <*****@*****.**>
  * 
  * @param Zend_Db_Table_Rowset $resultSet
  * @return Array de objetos Application_Model_Property
  */
 private function processResultSet(Zend_Db_Table_Rowset $resultSet)
 {
     $entries = array();
     foreach ($resultSet as $row) {
         //die('$row::<pre>' . print_r($row,true) . '</pre>');
         $entry = new Application_Model_Property();
         $entry->setId($row->id);
         $entry->setReference_no($row->reference_no);
         $entry->setTitle($row->title);
         $entry->setText($row->text);
         $entry->setDisposition_id($row->disposition_id);
         $entry->setArea($row->area);
         $entry->setFloor($row->floor);
         $entry->setLift($row->lift);
         $entry->setCellar($row->cellar);
         $entry->setBalcony($row->balcony);
         $entry->setLocation_id($row->location_id);
         $entry->setPrice($row->price);
         $entry->setCreated_on($row->created_on);
         $entry->setStreet($row->street);
         $entry->setProperty_build_id($row->property_build_id);
         $entry->setTerace($row->terace);
         $entry->setLoggia($row->loggia);
         $entry->setGarden($row->garden);
         $entry->setGarage($row->garage);
         $entry->setParking_place($row->parking_place);
         $entries[] = $entry;
     }
     //die('OK2 GetDbTable::fetchAll()<pre>' . print_r($entries,true) . '</pre>');
     return $entries;
 }
 public function saveFormAction()
 {
     $form = new Application_Form_PropertyForm();
     $request = $this->getRequest();
     $form->populate($request->getParams());
     $this->view->form = $form;
     if ($this->getRequest()->isPost()) {
         if ($form->isValid($_POST)) {
             $values = new Application_Model_Property($form->getValues());
             $mapper = new Application_Model_PropertyMapper();
             $values->setArea(str_replace(",", ".", $values->getArea()));
             $values->setPrice(str_replace(",", ".", $values->getPrice()));
             $newId = $mapper->save($values);
             $this->_redirect("/property/detail/property/" . $newId);
             return;
         }
     }
     $this->renderScript("property/add.phtml");
 }
Пример #3
0
 /**
  *
  * @param type $resultSet
  * @return Application_Model_Property
  */
 private function processResultSet($resultSet)
 {
     $entries = array();
     foreach ($resultSet as $row) {
         $entry = new Application_Model_Property();
         $entry->setId($row->id);
         $entry->setReference_no($row->reference_no);
         $entry->setTitle($row->title);
         $entry->setText($row->text);
         $entry->setDisposition_id($row->disposition_id);
         $entry->setArea($row->area);
         $entry->setFloor($row->floor);
         $entry->setLift($row->lift);
         $entry->setCellar($row->cellar);
         $entry->setBalcony($row->balcony);
         $entry->setLocation_id($row->location_id);
         $entry->setPrice($row->price);
         $entry->setCreated_on($row->created_on);
         $entry->setStreet($row->street);
         $entry->setProperty_build_id($row->property_build_id);
         $entry->setTerace($row->terace);
         $entry->setLoggia($row->loggia);
         $entry->setGarden($row->garden);
         $entry->setGarage($row->garage);
         $entry->setParking_place($row->parking_place);
         $entries[] = $entry;
     }
     return $entries;
 }