_db = Zend_Db::factory($configuration->databases->db->sdv1); } elseif(empty($config)){ $dbConfig = new Zend_Config_Ini(APPLICATION_PATH.'/configs/configuration.ini', 'databases'); $this->_db = Zend_Db::factory($dbConfig->db->sdv1); } $this->_db->setFetchMode(Zend_Db::FETCH_OBJ); } public function getCommandes($timestamp, $etat, $mode) { $dateTDebut = mktime(0, 0, 0, date('m', $timestamp), 1, date('Y', $timestamp)); $dateDebut = date('Y-m',$dateTDebut); $sql = $this->select()->where('dateCommande LIKE ?', $dateDebut.'%'); if (!empty($etat)){ $sql->where('statutCommande = ?', $etat); } if (!empty($mode) && $mode != '-'){ $sql->where('type = ?', $mode); } $sql->order('dateCommande ASC'); $result = $this->getAdapter()->fetchAll($sql); return $result; } public function getCommandesKbisById($id) { $sql = $this->select() ->where('id = ?', $id); $result = $this->getAdapter()->fetchAll($sql); return $result; } public function getCommandesKbisBySiren($siren) { $sql = $this->select() ->where('siren = ?', $siren) ->order('dateCommande ASC'); $result = $this->getAdapter()->fetchAll($sql); return $result; } }