diff options
author | Bharat Mediratta <bharat@menalto.com> | 2010-06-07 23:12:52 -0700 |
---|---|---|
committer | Bharat Mediratta <bharat@menalto.com> | 2010-06-07 23:12:52 -0700 |
commit | 6425d41eddd44091b2d83ba3c3734cc6990ca581 (patch) | |
tree | 94c6ad398edb6a72879b17772aab5670a1371b84 /modules/gallery/models | |
parent | 98fce83de5f772482382bfabdbcd94c25ecdbb1a (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/models')
-rw-r--r-- | modules/gallery/models/item.php | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/modules/gallery/models/item.php b/modules/gallery/models/item.php index dfcbdd70..f59caa65 100644 --- a/modules/gallery/models/item.php +++ b/modules/gallery/models/item.php @@ -923,12 +923,15 @@ class Item_Model extends ORM_MPTT { /** * Same as ORM::as_array() but convert id fields into their RESTful form. + * Convert any item ids into REST urls + * + * @param bool preserve_ids true if we should preserve ids */ - public function as_restful_array($convert_ids=true) { + public function as_restful_array($preserve_ids) { // Convert item ids to rest URLs for consistency $data = $this->as_array(); - if ($convert_ids) { + if (!$preserve_ids) { if ($tmp = $this->parent()) { $data["parent"] = rest::url("item", $tmp); } |