extranet/application/models/Commandes.php
2011-06-27 16:08:18 +00:00

32 lines
698 B
PHP

<?php
class Application_Model_Commandes extends Zend_Db_Table_Abstract
{
protected $_name = 'commandes';
public function getCommandesById($id)
{
$sql = $this->select()->where('idCommande = ?', $id);
$result = $this->getAdapter()->fetchAll($sql);
return $result;
}
public function getCommandesBySiren($siren)
{
$sql = $this->select()
->where('siren = ?', $siren)
->order('dateCommande ASC');
$result = $this->getAdapter()->fetchAll($sql);
return $result;
}
public function getCommandesByLogin($login)
{
$sql = $this->select()
->where('login = ?', $login)
->order('dateCommande ASC');
$result = $this->getAdapter()->fetchAll($sql);
return $result;
}
}