From fb29dc1e0ec6eb7947a945fc35c8d605127e3409 Mon Sep 17 00:00:00 2001 From: Cris Date: Tue, 5 Jan 2021 12:17:41 +0100 Subject: [PATCH] Added method getLvByStudent() to Lehrveranstaltung_model Signed-off-by: cris-technikum --- .../education/Lehrveranstaltung_model.php | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/application/models/education/Lehrveranstaltung_model.php b/application/models/education/Lehrveranstaltung_model.php index d80d02b41..ef5373f5f 100644 --- a/application/models/education/Lehrveranstaltung_model.php +++ b/application/models/education/Lehrveranstaltung_model.php @@ -273,4 +273,24 @@ class Lehrveranstaltung_model extends DB_Model return $this->execQuery($query, $parametersarray); } + + /** + * Gets Lehrveranstaltung and its Lehreinheiten (multiple rows possible). + * Returns empty array if student has no Lehrveranstaltung. + * @param $uid + * @param $studiensemester_kurzbz + * @param $lehrveranstaltung_id + * @return array|null + */ + public function getLvByStudent($uid, $studiensemester_kurzbz, $lehrveranstaltung_id) + { + $query = ' + SELECT * FROM campus.vw_student_lehrveranstaltung + WHERE uid = ? + AND studiensemester_kurzbz = ? + AND lehrveranstaltung_id = ?; + '; + + return $this->execQuery($query, array($uid, $studiensemester_kurzbz, $lehrveranstaltung_id)); + } }