webservice/application/models/Commandes.php
2010-10-26 13:21:15 +00:00

26 lines
594 B
PHP

<?php
class Application_Model_Commandes extends Zend_Db_Table_Abstract
{
protected $_name = 'commandes';
protected $_dependentTables = array('CommandesEven');
public function insert(array $data)
{
// Ajout d'un timestamp
if (empty($data['date_added'])) {
$data['date_added'] = date('Y-m-d H:i:s');
}
return parent::insert($data);
}
public function update(array $data)
{
if (empty($data['date_updated'])) {
$data['date_updated'] = date('Y-m-d H:i:s');
}
return parent::insert($data);
}
}