summaryrefslogtreecommitdiff
path: root/modules/gallery/helpers
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2010-02-12 04:53:26 -0800
committerBharat Mediratta <bharat@menalto.com>2010-02-12 04:53:26 -0800
commitce71ea6aa7eac72e54b1a9d7722c87beb61327de (patch)
tree408e96382d1cdf782ea6e2a0afbfd92770cfb9ad /modules/gallery/helpers
parent3439671bcfb99c1884285e4b4e53295f044e688f (diff)
Revert "1) Add a depth parameter to retrieving an item thru the rest api"
This reverts commit 3439671bcfb99c1884285e4b4e53295f044e688f.
Diffstat (limited to 'modules/gallery/helpers')
-rw-r--r--modules/gallery/helpers/item_rest.php14
1 files changed, 10 insertions, 4 deletions
diff --git a/modules/gallery/helpers/item_rest.php b/modules/gallery/helpers/item_rest.php
index 72230d8b..c0fc422a 100644
--- a/modules/gallery/helpers/item_rest.php
+++ b/modules/gallery/helpers/item_rest.php
@@ -30,9 +30,6 @@ class item_rest_Core {
* name=<substring>
* only return items where the name contains this substring
*
- * depth=<number>
- * return the children to the depth specified.
- *
* random=true
* return a single random item
*
@@ -73,7 +70,16 @@ class item_rest_Core {
$orm->where("type", "IN", explode(",", $p->type));
}
- return $item->as_restful_array(isset($p->depth) ? $p->depth : 0);
+ $members = array();
+ foreach ($orm->find_all() as $child) {
+ $members[] = rest::url("item", $child);
+ }
+
+ return array(
+ "url" => $request->url,
+ "entity" => $item->as_restful_array(),
+ "members" => $members,
+ "relationships" => rest::relationships("item", $item));
}
static function put($request) {