summaryrefslogtreecommitdiff
path: root/modules/gallery/models
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2009-11-26 12:09:04 -0800
committerBharat Mediratta <bharat@menalto.com>2009-11-26 12:09:04 -0800
commit1fd0e14359a7c7164573e4aa897c07680339e713 (patch)
tree62b01b88571e53810aa7f3efc2f0f01e727904e2 /modules/gallery/models
parent22823df22098ed1a69d88c2e5fdc30cd90f72c30 (diff)
Convert all DB where() calls to take 3 arguments.
Convert all open_paren() calls to and_open() or or_open() as appropriate.
Diffstat (limited to 'modules/gallery/models')
-rw-r--r--modules/gallery/models/item.php20
1 files changed, 10 insertions, 10 deletions
diff --git a/modules/gallery/models/item.php b/modules/gallery/models/item.php
index c8386b1c..c8d25cc5 100644
--- a/modules/gallery/models/item.php
+++ b/modules/gallery/models/item.php
@@ -288,9 +288,9 @@ class Item_Model extends ORM_MPTT {
foreach (Database::instance()
->select(array("name", "slug"))
->from("items")
- ->where("left_ptr <=", $this->left_ptr)
- ->where("right_ptr >=", $this->right_ptr)
- ->where("id <>", 1)
+ ->where("left_ptr", "<=", $this->left_ptr)
+ ->where("right_ptr", ">=", $this->right_ptr)
+ ->where("id", "<>", 1)
->order_by("left_ptr", "ASC")
->get() as $row) {
// Don't encode the names segment
@@ -433,8 +433,8 @@ class Item_Model extends ORM_MPTT {
// If the comparison column has NULLs in it, we can't use comparators on it and will have to
// deal with it the hard way.
$count = $db->from("items")
- ->where("parent_id", $this->id)
- ->where($this->sort_column, NULL)
+ ->where("parent_id", "=", $this->id)
+ ->where($this->sort_column, "=", NULL)
->where($where)
->count_records();
@@ -443,8 +443,8 @@ class Item_Model extends ORM_MPTT {
$sort_column = $this->sort_column;
$position = $db->from("items")
- ->where("parent_id", $this->id)
- ->where("$sort_column $comp ", $child->$sort_column)
+ ->where("parent_id", "=", $this->id)
+ ->where($sort_column, $comp, $child->$sort_column)
->where($where)
->count_records();
@@ -457,8 +457,8 @@ class Item_Model extends ORM_MPTT {
// Fix this by doing a 2nd query where we iterate over the equivalent columns and add them to
// our base value.
foreach ($db->from("items")
- ->where("parent_id", $this->id)
- ->where($sort_column, $child->$sort_column)
+ ->where("parent_id", "=", $this->id)
+ ->where($sort_column, "=", $child->$sort_column)
->where($where)
->order_by(array("id" => "ASC"))
->get() as $row) {
@@ -484,7 +484,7 @@ class Item_Model extends ORM_MPTT {
$position = 0;
foreach ($db->select("id")
->from("items")
- ->where("parent_id", $this->id)
+ ->where("parent_id", "=", $this->id)
->where($where)
->order_by($order_by)
->get() as $row) {