From 0da929dd4fc6f178cae3c60e47b3bc8d0b3c2b2c Mon Sep 17 00:00:00 2001 From: alex Date: Wed, 11 Apr 2018 10:54:17 +0200 Subject: [PATCH] Konten can be retrieved by Kostenstelle --- application/models/accounting/Konto_model.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/application/models/accounting/Konto_model.php b/application/models/accounting/Konto_model.php index d041909cd..d76b2bd46 100644 --- a/application/models/accounting/Konto_model.php +++ b/application/models/accounting/Konto_model.php @@ -11,4 +11,20 @@ class Konto_model extends DB_Model $this->dbTable = 'wawi.tbl_konto'; $this->pk = 'konto_id'; } + + /** + * Gets all Konten connected for a Kostenstelle + * @param $kostenstelle_id + * @return array + */ + public function getKontenForKostenstelle($kostenstelle_id) + { + $this->addJoin('wawi.tbl_konto_kostenstelle', 'konto_id'); + $konten = $this->loadWhere(array('kostenstelle_id' => $kostenstelle_id)); + + if ($konten->error) + return error($konten->retval); + + return $konten; + } }