From f03032e75fb60a142ed976e6788af339246e1d67 Mon Sep 17 00:00:00 2001 From: shadlaws Date: Sat, 15 Jun 2013 17:46:55 +0200 Subject: [PATCH] Revise REST relationships to pass on params (useful for "num" parameter). --- .../comment/classes/Comment/Controller/Rest/ItemComments.php | 2 +- .../gallery/classes/Gallery/Controller/Rest/UserComments.php | 2 +- modules/gallery/classes/Gallery/Controller/Rest/UserItems.php | 2 +- modules/tag/classes/Tag/Controller/Rest/ItemTags.php | 2 +- modules/tag/classes/Tag/Controller/Rest/TagItems.php | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/modules/comment/classes/Comment/Controller/Rest/ItemComments.php b/modules/comment/classes/Comment/Controller/Rest/ItemComments.php index c6c5206cf3..521765f099 100644 --- a/modules/comment/classes/Comment/Controller/Rest/ItemComments.php +++ b/modules/comment/classes/Comment/Controller/Rest/ItemComments.php @@ -110,6 +110,6 @@ static function delete($id, $params) { * as a relationship of an "item" resource. */ static function relationships($type, $id, $params) { - return ($type == "item") ? array("comments" => array("item_comments", $id)) : null; + return ($type == "item") ? array("comments" => array("item_comments", $id, $params)) : null; } } diff --git a/modules/gallery/classes/Gallery/Controller/Rest/UserComments.php b/modules/gallery/classes/Gallery/Controller/Rest/UserComments.php index b16a21599e..87f897154a 100644 --- a/modules/gallery/classes/Gallery/Controller/Rest/UserComments.php +++ b/modules/gallery/classes/Gallery/Controller/Rest/UserComments.php @@ -115,6 +115,6 @@ static function delete($id, $params) { * as a relationship of an "user" resource. */ static function relationships($type, $id, $params) { - return ($type == "user") ? array("comments" => array("user_comments", $id)) : null; + return ($type == "user") ? array("comments" => array("user_comments", $id, $params)) : null; } } diff --git a/modules/gallery/classes/Gallery/Controller/Rest/UserItems.php b/modules/gallery/classes/Gallery/Controller/Rest/UserItems.php index 592116bc06..ab9b9e3c08 100644 --- a/modules/gallery/classes/Gallery/Controller/Rest/UserItems.php +++ b/modules/gallery/classes/Gallery/Controller/Rest/UserItems.php @@ -136,6 +136,6 @@ static function delete($id, $params) { * as a relationship of a "user" resource. */ static function relationships($type, $id, $params) { - return ($type == "user") ? array("items" => array("user_items", $id)) : null; + return ($type == "user") ? array("items" => array("user_items", $id, $params)) : null; } } diff --git a/modules/tag/classes/Tag/Controller/Rest/ItemTags.php b/modules/tag/classes/Tag/Controller/Rest/ItemTags.php index 5b459b4845..e37dda1bb5 100644 --- a/modules/tag/classes/Tag/Controller/Rest/ItemTags.php +++ b/modules/tag/classes/Tag/Controller/Rest/ItemTags.php @@ -146,6 +146,6 @@ static function delete($id, $params) { * as a relationship of an "item" resource. */ static function relationships($type, $id, $params) { - return ($type == "item") ? array("tags" => array("item_tags", $id)) : null; + return ($type == "item") ? array("tags" => array("item_tags", $id, $params)) : null; } } diff --git a/modules/tag/classes/Tag/Controller/Rest/TagItems.php b/modules/tag/classes/Tag/Controller/Rest/TagItems.php index 174dc3539e..8b016583bd 100644 --- a/modules/tag/classes/Tag/Controller/Rest/TagItems.php +++ b/modules/tag/classes/Tag/Controller/Rest/TagItems.php @@ -143,6 +143,6 @@ static function delete($id, $params) { * as a relationship of a "tag" resource. */ static function relationships($type, $id, $params) { - return ($type == "tag") ? array("items" => array("tag_items", $id)) : null; + return ($type == "tag") ? array("items" => array("tag_items", $id, $params)) : null; } }