. */ namespace Volkszaehler\View\JSON; /** * JSON group view * * @author Steffen Vogel * @package group */ class JSONGroupView extends JSONView { public function add(\Volkszaehler\Model\Group $obj, $recursive = FALSE) { $group['uuid'] = (string) $obj->getUuid(); $group['name'] = $obj->getName(); $group['description'] = $obj->getDescription(); if ($recursive) { // TODO add nested groups in json view $children = $obj->getChildren(); foreach ($children as $child) { $this->addGroup($child, $recursive); } } $this->json['groups'][] = $group; } } ?>