mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-20 00:12:15 +00:00
- Create new function getError in helper hlp_return_object_helper that should just returns retval
- Replace all show_error(getData( with show_error(getError( - Replace all error($...->retval) with error(getError($...)) - Replace all ->outputJsonError(getData( with ->outputJsonError(getError( - Replace all show_error($...->retval with show_error(getError($... - Replace all outputJsonError($...->retval with outputJsonError(getError$... - Replace all return error($...->retval) with return $...
This commit is contained in:
@@ -29,8 +29,7 @@ class PersonLock_model extends DB_Model
|
||||
|
||||
$result = $this->loadWhere($lockdata);
|
||||
|
||||
if ($result->error)
|
||||
return error($result->retval);
|
||||
if ($result->error) return $result;
|
||||
|
||||
if (count($result->retval) > 0)
|
||||
return success($result->retval);
|
||||
@@ -49,8 +48,7 @@ class PersonLock_model extends DB_Model
|
||||
{
|
||||
$locked = $this->checkIfLocked($person_id, $app);
|
||||
|
||||
if ($locked->error)
|
||||
return error($locked->retval);
|
||||
if ($locked->error) return $locked;
|
||||
|
||||
//insert only if not already locked
|
||||
if ($locked->retval === null)
|
||||
@@ -77,8 +75,7 @@ class PersonLock_model extends DB_Model
|
||||
foreach ($locks->retval as $lock)
|
||||
{
|
||||
$result = $this->delete($lock->lock_id);
|
||||
if ($result->error)
|
||||
return error($result->retval);
|
||||
if ($result->error) return $result;
|
||||
|
||||
$deleted[] = $lock;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user