mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-16 22:42:16 +00:00
Added method getParent()
This method gets only one parent of given organisational unit. This ist to easily retrieve department of a studiengang or fakultät of department etc.
This commit is contained in:
@@ -165,4 +165,27 @@ class Organisationseinheit_model extends DB_Model
|
||||
return $this->execQuery(sprintf($query, $aktivstring, $aktivstring), array($oe_kurzbz));
|
||||
}
|
||||
|
||||
/**
|
||||
* Get one parent only.
|
||||
* Easily retrieve department of a studiengang or fakultät of department etc.
|
||||
* @param $oe_kurzbz
|
||||
* @return array|null
|
||||
*/
|
||||
public function getParent($oe_kurzbz)
|
||||
{
|
||||
if (is_string($oe_kurzbz))
|
||||
{
|
||||
$condition = '
|
||||
oe_kurzbz = (
|
||||
SELECT
|
||||
oe_parent_kurzbz
|
||||
FROM
|
||||
public.tbl_organisationseinheit
|
||||
WHERE
|
||||
oe_kurzbz = \''. $oe_kurzbz. '\'
|
||||
)
|
||||
';
|
||||
}
|
||||
return $this->loadWhere($condition);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user