mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-25 00:24:35 +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:
@@ -158,8 +158,7 @@ class Person_model extends DB_Model
|
||||
|
||||
$person = $this->load($person_id);
|
||||
|
||||
if($person->error)
|
||||
return error($person->retval);
|
||||
if($person->error) return $person;
|
||||
|
||||
//return null if not found
|
||||
if(count($person->retval) < 1)
|
||||
@@ -170,14 +169,13 @@ class Person_model extends DB_Model
|
||||
$this->KontaktModel->addOrder('kontakttyp');
|
||||
$where = $zustellung_only === true ? array('person_id' => $person_id, 'zustellung' => true) : array('person_id' => $person_id);
|
||||
$kontakte = $this->KontaktModel->loadWhere($where);
|
||||
if($kontakte->error)
|
||||
return error($kontakte->retval);
|
||||
if($kontakte->error) return $kontakte;
|
||||
|
||||
$where = $zustellung_only === true ? array('person_id' => $person_id, 'zustelladresse' => true) : array('person_id' => $person_id);
|
||||
$this->AdresseModel->addSelect('public.tbl_adresse.*, bis.tbl_nation.kurztext AS nationkurztext');
|
||||
$this->AdresseModel->addJoin('bis.tbl_nation', 'tbl_adresse.nation = tbl_nation.nation_code', 'LEFT');
|
||||
$adressen = $this->AdresseModel->loadWhere($where);
|
||||
if($adressen->error)
|
||||
return error($adressen->retval);
|
||||
if($adressen->error) return $adressen;
|
||||
|
||||
$stammdaten = $person->retval[0];
|
||||
$stammdaten->kontakte = $kontakte->retval;
|
||||
|
||||
Reference in New Issue
Block a user