Пример #1
0
 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);
 }
Пример #2
0
 public function clear()
 {
     parent::clear();
     $this->rights = array();
 }
Пример #3
0
 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);
 }
Пример #4
0
 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);
     }
 }