extranet/application/models/Commandes.php

32 lines
698 B
PHP
Raw Normal View History

2011-05-11 14:16:42 +00:00
<?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;
}
2011-05-11 14:16:42 +00:00
}