From 8a75bc9fdd5ae7882abd2064eafc581191968dab Mon Sep 17 00:00:00 2001 From: Cris Date: Tue, 26 Jan 2021 18:54:42 +0100 Subject: [PATCH] Added method getFullName() to Person_model Signed-off-by: cris-technikum --- application/models/person/Person_model.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/application/models/person/Person_model.php b/application/models/person/Person_model.php index 128af7860..e005e243c 100644 --- a/application/models/person/Person_model.php +++ b/application/models/person/Person_model.php @@ -248,4 +248,19 @@ class Person_model extends DB_Model return $this->execQuery($qry, $parametersArray); } + + /** + * Get full name of given uid. (Vorname Nachname) + * @param $uid + * @return array + */ + public function getFullName($uid) + { + if (!$result = getData($this->getByUid($uid))[0]) + { + show_error('Failed loading person'); + } + + return success($result->vorname. ' '. $result->nachname); + } }