diff --git a/restapi/index.php b/restapi/index.php index 15a695ec2..97a9cf3b2 100644 --- a/restapi/index.php +++ b/restapi/index.php @@ -44,13 +44,19 @@ class RestapiController { /* {{{ */ } /* }}} */ protected function __getDocumentData($document) { /* {{{ */ + $cats = $document->getCategories(); + $tmp = []; + foreach($cats as $cat) { + $tmp[] = $this->__getCategoryData($cat); + } $data = array( 'type'=>'document', 'id'=>(int)$document->getId(), 'date'=>date('Y-m-d H:i:s', $document->getDate()), 'name'=>$document->getName(), 'comment'=>$document->getComment(), - 'keywords'=>$document->getKeywords() + 'keywords'=>$document->getKeywords(), + 'categories'=>$tmp ); return $data; } /* }}} */