29 lines
705 B
PHP
29 lines
705 B
PHP
|
<?php
|
||
|
/**
|
||
|
* xml abstract class
|
||
|
*/
|
||
|
class UsersTable extends Zend_Db_Table
|
||
|
{
|
||
|
protected $_name = 'users';
|
||
|
public function insert(array $data)
|
||
|
{
|
||
|
// add a timestamp
|
||
|
if (empty($data['ts_created'])) {
|
||
|
$data['ts_created'] = date("y-m-d h:i:s",time());
|
||
|
}
|
||
|
if (!empty($data['password'])) {
|
||
|
$data['password']=md5($data['password']);
|
||
|
}
|
||
|
return parent::insert($data);
|
||
|
}
|
||
|
|
||
|
public function update(array $data, $where)
|
||
|
{
|
||
|
// add a timestamp
|
||
|
if (empty($data['ts_last_login'])) {
|
||
|
$data['ts_last_login'] = date("y-m-d h:i:s",time());
|
||
|
}
|
||
|
return parent::update($data, $where);
|
||
|
}
|
||
|
}
|