added method

This commit is contained in:
Stefan Puraner
2016-03-22 11:06:55 +01:00
parent def7fc7292
commit d690fd8cb8
+25
View File
@@ -1307,6 +1307,31 @@ class lehrveranstaltung extends basis_db
}
return $childs;
}
/**
* Generiert die Subtrees des Lehrveranstaltungstrees
*/
public function hasChildren($studienplan_lehrveranstaltung_id)
{
$childs = array();
foreach ($this->lehrveranstaltungen as $row)
{
if ($row->studienplan_lehrveranstaltung_id_parent === $studienplan_lehrveranstaltung_id)
{
$childs[$row->studienplan_lehrveranstaltung_id] = $row;
$childs[$row->studienplan_lehrveranstaltung_id]->childs = $this->getLehrveranstaltungTreeChilds($row->studienplan_lehrveranstaltung_id);
}
}
if(count($childs) > 0)
{
return true;
}
else
{
return false;
}
}
/**
* Baut die Datenstruktur für senden als JSON Objekt auf