mirror of
https://github.com/slawkens/myaac.git
synced 2025-10-17 19:23:27 +02:00
Avoid globals where possible
$logged => logged() $account_logged => accountLogged()
This commit is contained in:
@@ -168,10 +168,8 @@ class FAQ
|
||||
|
||||
static public function move($id, $i, &$errors)
|
||||
{
|
||||
global $db;
|
||||
$row = ModelsFAQ::find($id);
|
||||
if($row)
|
||||
{
|
||||
if($row) {
|
||||
$ordering = $row->ordering + $i;
|
||||
$old_record = ModelsFAQ::where('ordering', $ordering)->first();
|
||||
if($old_record) {
|
||||
@@ -182,8 +180,9 @@ class FAQ
|
||||
$row->ordering = $ordering;
|
||||
$row->save();
|
||||
}
|
||||
else
|
||||
else {
|
||||
$errors[] = 'FAQ with id ' . $id . ' does not exists.';
|
||||
}
|
||||
|
||||
return !count($errors);
|
||||
}
|
||||
|
Reference in New Issue
Block a user