function update($condition, $set_or_inc = [], $par = array('multiple' => false)) { if (strpos(arr::get($set_or_inc, 0)['k'], '$') === false) { $set_or_inc = ['$set' => $set_or_inc]; } return $this->collection->update($condition, $set_or_inc, $par); }
static function level($full) { $i = 1000000; foreach ($full as $k => $v) { $j = $v->level; if ($j) { $out[$j][$k] = $v; $out[$j]['level'] = $j; } else { $out[$i][$k] = $v; $out[$i]['level'] = $j; } $i--; } $out = arr::order_by($out, 'level', SORT_DESC); foreach ($out as $v) { foreach ($v as $key => $value) { if ($key == 'level') { continue; } $new[$key] = $value; } } return $new; }