public function update($datas = null, $where = null) { if ($datas == null) { $datas = $this->toArray(); $this->clear(); } $time = time(); $datas['update_time'] = $time; return parent::update($datas, $where); }
public function clear() { parent::clear(); $this->rights = array(); }
public function getGrouped($where = null, $filters = null, $type = 'object', $columns = null) { $this->db->order_by('is_folder DESC, name ASC'); if ($filters && !in_array('all', $filters)) { $this->db->group_start()->where_in('type', $filters)->or_where('type', null)->group_end(); } if ($where) { $this->db->where($where); } return parent::get(NULL, $type, $columns); }
protected function beforeUpdate(&$datas = null, $where = null) { parent::beforeUpdate($datas, $where); if (isset($datas['password']) && $datas['password']) { $datas['password'] = password_hash($datas['password'], PASSWORD_DEFAULT); } }