Correction Fetch Object

This commit is contained in:
Michael RICOIS 2012-01-30 09:25:39 +00:00
parent cc723e5006
commit 7308c81bad
2 changed files with 8 additions and 2 deletions

View File

@ -24,6 +24,7 @@ class Application_Model_Commandes extends Zend_Db_Table_Abstract
if (!empty($etat)){ if (!empty($etat)){
$sql->where('statutCommande = ?', $etat); $sql->where('statutCommande = ?', $etat);
} }
$this->getAdapter()->setFetchMode(Zend_Db::FETCH_OBJ);
$result = $this->getAdapter()->fetchAll($sql); $result = $this->getAdapter()->fetchAll($sql);
return $result; return $result;
} }
@ -31,6 +32,7 @@ class Application_Model_Commandes extends Zend_Db_Table_Abstract
public function getCommandesById($id) public function getCommandesById($id)
{ {
$sql = $this->select()->where('idCommande = ?', $id); $sql = $this->select()->where('idCommande = ?', $id);
$this->getAdapter()->setFetchMode(Zend_Db::FETCH_OBJ);
$result = $this->getAdapter()->fetchAll($sql); $result = $this->getAdapter()->fetchAll($sql);
return $result; return $result;
} }
@ -40,6 +42,7 @@ class Application_Model_Commandes extends Zend_Db_Table_Abstract
$sql = $this->select() $sql = $this->select()
->where('siren = ?', $siren) ->where('siren = ?', $siren)
->order('dateCommande ASC'); ->order('dateCommande ASC');
$this->getAdapter()->setFetchMode(Zend_Db::FETCH_OBJ);
$result = $this->getAdapter()->fetchAll($sql); $result = $this->getAdapter()->fetchAll($sql);
return $result; return $result;
} }
@ -53,7 +56,7 @@ class Application_Model_Commandes extends Zend_Db_Table_Abstract
->where('login = ?', $login) ->where('login = ?', $login)
->order('dateCommande ASC') ->order('dateCommande ASC')
->where('dateCommande LIKE ?', $dateDebut.'%'); ->where('dateCommande LIKE ?', $dateDebut.'%');
$this->getAdapter()->setFetchMode(Zend_Db::FETCH_OBJ);
$result = $this->getAdapter()->fetchAll($sql); $result = $this->getAdapter()->fetchAll($sql);
return $result; return $result;
} }

View File

@ -15,6 +15,7 @@ class Application_Model_CommandesKbis extends Zend_Db_Table_Abstract
$sql->where('type = ?', $mode); $sql->where('type = ?', $mode);
} }
$sql->order('dateCommande ASC'); $sql->order('dateCommande ASC');
$this->getAdapter()->setFetchMode(Zend_Db::FETCH_OBJ);
$result = $this->getAdapter()->fetchAll($sql); $result = $this->getAdapter()->fetchAll($sql);
return $result; return $result;
} }
@ -23,6 +24,7 @@ class Application_Model_CommandesKbis extends Zend_Db_Table_Abstract
{ {
$sql = $this->select() $sql = $this->select()
->where('id = ?', $id); ->where('id = ?', $id);
$this->getAdapter()->setFetchMode(Zend_Db::FETCH_OBJ);
$result = $this->getAdapter()->fetchAll($sql); $result = $this->getAdapter()->fetchAll($sql);
return $result; return $result;
} }
@ -32,6 +34,7 @@ class Application_Model_CommandesKbis extends Zend_Db_Table_Abstract
$sql = $this->select() $sql = $this->select()
->where('siren = ?', $siren) ->where('siren = ?', $siren)
->order('dateCommande ASC'); ->order('dateCommande ASC');
$this->getAdapter()->setFetchMode(Zend_Db::FETCH_OBJ);
$result = $this->getAdapter()->fetchAll($sql); $result = $this->getAdapter()->fetchAll($sql);
return $result; return $result;
} }