summaryrefslogtreecommitdiff
path: root/modules/gallery
diff options
context:
space:
mode:
Diffstat (limited to 'modules/gallery')
-rw-r--r--modules/gallery/helpers/gallery_installer.php2
-rw-r--r--modules/gallery/helpers/item_rest.php2
-rw-r--r--modules/gallery/libraries/ORM_MPTT.php2
-rw-r--r--modules/gallery/models/item.php4
4 files changed, 5 insertions, 5 deletions
diff --git a/modules/gallery/helpers/gallery_installer.php b/modules/gallery/helpers/gallery_installer.php
index aa297236..bfab4645 100644
--- a/modules/gallery/helpers/gallery_installer.php
+++ b/modules/gallery/helpers/gallery_installer.php
@@ -228,7 +228,7 @@ class gallery_installer {
"updated" => $now,
"weight" => 1))
->execute();
- $root = ORM::factory("item")->where("id", "=", 1)->find();
+ $root = ORM::factory("item", 1);
access::add_item($root);
module::set_var("gallery", "active_site_theme", "wind");
diff --git a/modules/gallery/helpers/item_rest.php b/modules/gallery/helpers/item_rest.php
index 2236fbbb..d5ca1456 100644
--- a/modules/gallery/helpers/item_rest.php
+++ b/modules/gallery/helpers/item_rest.php
@@ -145,7 +145,7 @@ class item_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/gallery/libraries/ORM_MPTT.php b/modules/gallery/libraries/ORM_MPTT.php
index a7bb24ea..83f9b51e 100644
--- a/modules/gallery/libraries/ORM_MPTT.php
+++ b/modules/gallery/libraries/ORM_MPTT.php
@@ -48,7 +48,7 @@ class ORM_MPTT_Core extends ORM {
function save() {
if (!$this->loaded()) {
$this->lock();
- $parent = ORM::factory("item")->where("id", "=", $this->parent_id)->find();
+ $parent = ORM::factory("item", $this->parent_id);
try {
// Make a hole in the parent for this new item
diff --git a/modules/gallery/models/item.php b/modules/gallery/models/item.php
index 9706d61f..ae1b6608 100644
--- a/modules/gallery/models/item.php
+++ b/modules/gallery/models/item.php
@@ -423,7 +423,7 @@ class Item_Model extends ORM_MPTT {
// If any significant fields have changed, load up a copy of the original item and
// keep it around.
- $original = ORM::factory("item")->where("id", "=", $this->id)->find();
+ $original = ORM::factory("item", $this->id);
if (array_intersect($this->changed, array("parent_id", "name", "slug"))) {
$original->_build_relative_caches();
$this->relative_path_cache = null;
@@ -787,7 +787,7 @@ class Item_Model extends ORM_MPTT {
if ($this->is_movie() || $this->is_photo()) {
if ($this->loaded()) {
// Existing items can't change their extension
- $original = ORM::factory("item")->where("id", "=", $this->id)->find();
+ $original = ORM::factory("item", $this->id);
$new_ext = pathinfo($this->name, PATHINFO_EXTENSION);
$old_ext = pathinfo($original->name, PATHINFO_EXTENSION);
if (strcasecmp($new_ext, $old_ext)) {