diff options
author | Bharat Mediratta <bharat@menalto.com> | 2010-01-27 22:34:11 -0800 |
---|---|---|
committer | Bharat Mediratta <bharat@menalto.com> | 2010-01-27 22:34:11 -0800 |
commit | 4b32a71afc7650fe7bdd02ba384c8914f60538f3 (patch) | |
tree | 66fea701b9324c1de79c31c548b643f331566223 /modules/tag/helpers | |
parent | cfbbf9ef606094868ccbd25ccf65e1a6f610528b (diff) |
Convert back to using ORM::factory(..., $id) instead of calling where().
Diffstat (limited to 'modules/tag/helpers')
-rw-r--r-- | modules/tag/helpers/item_tags_rest.php | 2 | ||||
-rw-r--r-- | modules/tag/helpers/tag_item_rest.php | 4 | ||||
-rw-r--r-- | modules/tag/helpers/tag_items_rest.php | 2 | ||||
-rw-r--r-- | modules/tag/helpers/tag_rest.php | 2 |
4 files changed, 5 insertions, 5 deletions
diff --git a/modules/tag/helpers/item_tags_rest.php b/modules/tag/helpers/item_tags_rest.php index ce814f77..43e2cef0 100644 --- a/modules/tag/helpers/item_tags_rest.php +++ b/modules/tag/helpers/item_tags_rest.php @@ -50,7 +50,7 @@ class item_tags_rest_Core { } static function resolve($id) { - $item = ORM::factory("item")->where("id", "=", $id)->find(); + $item = ORM::factory("item", $id); if (!access::can("view", $item)) { throw new Kohana_404_Exception(); } diff --git a/modules/tag/helpers/tag_item_rest.php b/modules/tag/helpers/tag_item_rest.php index cd9bb6fe..60d37437 100644 --- a/modules/tag/helpers/tag_item_rest.php +++ b/modules/tag/helpers/tag_item_rest.php @@ -35,8 +35,8 @@ class tag_item_rest_Core { static function resolve($tuple) { list ($tag_id, $item_id) = split(",", $tuple); - $tag = ORM::factory("tag")->where("id", "=", $tag_id)->find(); - $item = ORM::factory("item")->where("id", "=", $item_id)->find(); + $tag = ORM::factory("tag", $tag_id); + $item = ORM::factory("item", $item_id); if (!$tag->loaded() || !$item->loaded() || !$tag->has($item)) { throw new Kohana_404_Exception(); } diff --git a/modules/tag/helpers/tag_items_rest.php b/modules/tag/helpers/tag_items_rest.php index 369a8d83..ef563ac6 100644 --- a/modules/tag/helpers/tag_items_rest.php +++ b/modules/tag/helpers/tag_items_rest.php @@ -52,7 +52,7 @@ class tag_items_rest_Core { } static function resolve($id) { - return ORM::factory("tag")->where("id", "=", $id)->find(); + return ORM::factory("tag", $id); } static function url($tag) { diff --git a/modules/tag/helpers/tag_rest.php b/modules/tag/helpers/tag_rest.php index 7143daa9..4879cf63 100644 --- a/modules/tag/helpers/tag_rest.php +++ b/modules/tag/helpers/tag_rest.php @@ -77,7 +77,7 @@ class tag_rest_Core { } static function resolve($id) { - $tag = ORM::factory("tag")->where("id", "=", $id)->find(); + $tag = ORM::factory("tag", $id); if (!$tag->loaded()) { throw new Kohana_404_Exception(); } |