public function update(array $data, $where) { if (isset($data['password']) and $data['password']) { $data['password'] = md5($data['password']); } return parent::update($data, $where); }
public function update(array $data, $where) { //save a snapshot now require_once 'History.php'; $historyTable = new History('trainer'); //cheezy way to get the id $parts = explode('=', $where[0]); $pid = trim($parts[1]); //link to the last history row $personHistoryTable = new History('person'); $hrow = $personHistoryTable->fetchAll("person_id = {$pid}", "vid DESC", 1); $historyTable->insert($this, $hrow->current()->vid); $rslt = parent::update($data, $where); return $rslt; }
public function update(array $data, $where) { //save a snapshot now require_once 'History.php'; $historyTable = new History('person'); //cheezy way to get the id $parts = explode('=', $where[0]); $historyTable->insert($this, trim($parts[1])); $rslt = parent::update($data, $where); return $rslt; }