From 8a9e040554f63d9310d97b9c9234c5808c7832f3 Mon Sep 17 00:00:00 2001 From: Alexei Karpenko Date: Tue, 13 Aug 2024 16:57:05 +0200 Subject: [PATCH] added Gehaltstyp model --- .../vertragsbestandteil/GehaltsTyp_model.php | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 application/models/vertragsbestandteil/GehaltsTyp_model.php diff --git a/application/models/vertragsbestandteil/GehaltsTyp_model.php b/application/models/vertragsbestandteil/GehaltsTyp_model.php new file mode 100644 index 000000000..c933a3b38 --- /dev/null +++ b/application/models/vertragsbestandteil/GehaltsTyp_model.php @@ -0,0 +1,28 @@ +dbTable = 'hr.tbl_gehaltstyp'; + $this->pk = 'gehaltstyp_kurzbz'; + } + + /** + * Gets Gehaltstyp for a Gehaltsbestandteil. + * @param int gehaltsbestandteil_id + * @return object the typ + */ + public function getGehaltstypByGehaltsbestandteil($gehaltsbestandteil_id) + { + $gehaltsTyp = null; + $this->addJoin('hr.tbl_gehaltsbestandteil', 'gehaltstyp_kurzbz'); + $result = $this->loadWhere(['gehaltsbestandteil_id' => $gehaltsbestandteil_id]); + + if (hasData($result)) $gehaltsTyp = getData($result)[0]; + + return $gehaltsTyp; + } +}