mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-14 05:31:42 +00:00
__getDocumentData() sets categories
This commit is contained in:
parent
2a2035cccf
commit
cab5f5bb2e
|
@ -44,13 +44,19 @@ class RestapiController { /* {{{ */
|
||||||
} /* }}} */
|
} /* }}} */
|
||||||
|
|
||||||
protected function __getDocumentData($document) { /* {{{ */
|
protected function __getDocumentData($document) { /* {{{ */
|
||||||
|
$cats = $document->getCategories();
|
||||||
|
$tmp = [];
|
||||||
|
foreach($cats as $cat) {
|
||||||
|
$tmp[] = $this->__getCategoryData($cat);
|
||||||
|
}
|
||||||
$data = array(
|
$data = array(
|
||||||
'type'=>'document',
|
'type'=>'document',
|
||||||
'id'=>(int)$document->getId(),
|
'id'=>(int)$document->getId(),
|
||||||
'date'=>date('Y-m-d H:i:s', $document->getDate()),
|
'date'=>date('Y-m-d H:i:s', $document->getDate()),
|
||||||
'name'=>$document->getName(),
|
'name'=>$document->getName(),
|
||||||
'comment'=>$document->getComment(),
|
'comment'=>$document->getComment(),
|
||||||
'keywords'=>$document->getKeywords()
|
'keywords'=>$document->getKeywords(),
|
||||||
|
'categories'=>$tmp
|
||||||
);
|
);
|
||||||
return $data;
|
return $data;
|
||||||
} /* }}} */
|
} /* }}} */
|
||||||
|
|
Loading…
Reference in New Issue
Block a user