summaryrefslogtreecommitdiff
path: root/modules/gallery/helpers/item_rest.php
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2010-06-07 23:12:52 -0700
committerBharat Mediratta <bharat@menalto.com>2010-06-07 23:12:52 -0700
commit6425d41eddd44091b2d83ba3c3734cc6990ca581 (patch)
tree94c6ad398edb6a72879b17772aab5670a1371b84 /modules/gallery/helpers/item_rest.php
parent98fce83de5f772482382bfabdbcd94c25ecdbb1a (diff)
Add a "preserve_ids" global query parameter for REST requests that
indicates that we shouldn't opportunistically convert ids into REST urls.
Diffstat (limited to 'modules/gallery/helpers/item_rest.php')
-rw-r--r--modules/gallery/helpers/item_rest.php3
1 files changed, 2 insertions, 1 deletions
diff --git a/modules/gallery/helpers/item_rest.php b/modules/gallery/helpers/item_rest.php
index c88f92d9..1d19d9f1 100644
--- a/modules/gallery/helpers/item_rest.php
+++ b/modules/gallery/helpers/item_rest.php
@@ -78,9 +78,10 @@ class item_rest_Core {
}
$orm->order_by($order_by);
+ $preserve_ids = isset($p->preserve_ids) ? (bool)$p->preserve_ids : false;
$result = array(
"url" => $request->url,
- "entity" => $item->as_restful_array(),
+ "entity" => $item->as_restful_array($preserve_ids),
"relationships" => rest::relationships("item", $item));
if ($item->is_album()) {
$result["members"] = array();