Skip to content

Commit

Permalink
Revise REST relationships to pass on params (useful for "num" paramet…
Browse files Browse the repository at this point in the history
…er).
  • Loading branch information
shadlaws committed Jun 15, 2013
1 parent 9b4c052 commit f03032e
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
Expand Up @@ -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;
}
}
Expand Up @@ -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;
}
}
Expand Up @@ -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;
}
}
2 changes: 1 addition & 1 deletion modules/tag/classes/Tag/Controller/Rest/ItemTags.php
Expand Up @@ -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;
}
}
2 changes: 1 addition & 1 deletion modules/tag/classes/Tag/Controller/Rest/TagItems.php
Expand Up @@ -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;
}
}

0 comments on commit f03032e

Please sign in to comment.