select()->where('dateCommande LIKE ?', $dateDebut.'%'); if (!empty($mode)){ if ( $mode == 'G' ) { $sql->where('typeCommande IN (?) ', array('', $mode)); } else { $sql->where('typeCommande = ?', $mode); } } if (!empty($etat)){ $sql->where('statutCommande = ?', $etat); } $this->getAdapter()->setFetchMode(Zend_Db::FETCH_OBJ); $result = $this->getAdapter()->fetchAll($sql); return $result; } public function getCommandesById($id) { $sql = $this->select()->where('idCommande = ?', $id); $this->getAdapter()->setFetchMode(Zend_Db::FETCH_OBJ); $result = $this->getAdapter()->fetchAll($sql); return $result; } public function getCommandesBySiren($siren) { $sql = $this->select() ->where('siren = ?', $siren) ->order('dateCommande ASC'); $this->getAdapter()->setFetchMode(Zend_Db::FETCH_OBJ); $result = $this->getAdapter()->fetchAll($sql); return $result; } public function getCommandesByLogin($login, $timestamp) { $dateTDebut = mktime(0, 0, 0, date('m', $timestamp), 1, date('Y', $timestamp)); $dateDebut = date('Y-m',$dateTDebut); $sql = $this->select() ->where('login = ?', $login) ->order('dateCommande ASC') ->where('dateCommande LIKE ?', $dateDebut.'%'); $this->getAdapter()->setFetchMode(Zend_Db::FETCH_OBJ); $result = $this->getAdapter()->fetchAll($sql); return $result; } }