summaryrefslogtreecommitdiffstats
path: root/lib/ocs
diff options
context:
space:
mode:
authorTom Needham <needham.thomas@gmail.com>2012-12-12 20:58:40 +0000
committerTom Needham <needham.thomas@gmail.com>2012-12-12 20:58:40 +0000
commit228a75ebaa3a8fd543ea473bc23ba0b11a028511 (patch)
tree43f1d55269632872377263f4a65f490b7b0bad4e /lib/ocs
parent3cc34055368114d81e722adea03a2118e78d2aac (diff)
downloadnextcloud-server-228a75ebaa3a8fd543ea473bc23ba0b11a028511.tar.gz
nextcloud-server-228a75ebaa3a8fd543ea473bc23ba0b11a028511.zip
API: Include totalitems and itemsperpage meta data when needed.
Diffstat (limited to 'lib/ocs')
-rw-r--r--lib/ocs/result.php8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/ocs/result.php b/lib/ocs/result.php
index a7199cb5ac7..24029051da5 100644
--- a/lib/ocs/result.php
+++ b/lib/ocs/result.php
@@ -26,7 +26,7 @@ class OC_OCS_Result{
* optionally set the total number of items available
* @param $items int
*/
- public function setItems(int $items){
+ public function setTotalItems(int $items){
$this->items = $items;
}
@@ -56,6 +56,12 @@ class OC_OCS_Result{
$return['meta']['status'] = ($this->statuscode === 100) ? 'ok' : 'failure';
$return['meta']['statuscode'] = $this->statuscode;
$return['meta']['message'] = $this->message;
+ if(isset($this->items)){
+ $return['meta']['totalitems'] = $this->items;
+ }
+ if(isset($this->perpage)){
+ $return['meta']['itemsperpage'] = $this->perpage;
+ }
$return['data'] = $this->data;
// Return the result data.
return $return;