function print_groups($group) { $groups = Groups::get_by_parent($group); if ($groups) { echo "<ul>"; foreach ($groups as $group) { echo "<li data-group-id=\"" . $group->get_id() . "\" data-description=\"" . $group->get_description() . "\">" . $group->get_name() . "</li>"; print_groups($group); } echo "</ul>"; } }
public function get_children() { return Groups::get_by_parent($this); }