From 799911b94831a143a09890f6a40afb8a893df531 Mon Sep 17 00:00:00 2001 From: Werner Masik Date: Thu, 17 Aug 2023 16:14:43 +0200 Subject: [PATCH] added method to fetch DV by ID --- .../vertragsbestandteil/Dienstverhaeltnis_model.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/application/models/vertragsbestandteil/Dienstverhaeltnis_model.php b/application/models/vertragsbestandteil/Dienstverhaeltnis_model.php index 5cbc1e40d..5e9379a41 100644 --- a/application/models/vertragsbestandteil/Dienstverhaeltnis_model.php +++ b/application/models/vertragsbestandteil/Dienstverhaeltnis_model.php @@ -62,6 +62,17 @@ class Dienstverhaeltnis_model extends DB_Model } + public function getDVByID($dvid) { + $this->addSelect('hr.tbl_dienstverhaeltnis.*, public.tbl_organisationseinheit.bezeichnung as unternehmen'); + $this->addJoin('public.tbl_organisationseinheit', 'hr.tbl_dienstverhaeltnis.oe_kurzbz = public.tbl_organisationseinheit.oe_kurzbz'); + $result = $this->load($dvid); + + if (hasData($result)) { + return $result; + } + return error('could not fetch DV by ID'); + } + public function getCurrentDVByPersonUID($uid, $dateAsUnixTS) {