2011-05-19 08:46:55 +00:00
|
|
|
<?php
|
|
|
|
class Application_Model_CommandesKbis extends Zend_Db_Table_Abstract
|
|
|
|
{
|
|
|
|
protected $_name = 'commandes_kbis';
|
2011-06-27 16:08:18 +00:00
|
|
|
|
2011-09-27 15:33:24 +00:00
|
|
|
public function __construct()
|
|
|
|
{
|
|
|
|
$dbConfig = new Zend_Config_Ini(APPLICATION_PATH.'/configs/databases.ini');
|
|
|
|
$this->_db = Zend_Db::factory($dbConfig->db->sdv1);
|
|
|
|
}
|
|
|
|
|
2011-06-27 16:08:18 +00:00
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
2011-05-19 08:46:55 +00:00
|
|
|
}
|