diff options
| author | Bharat Mediratta <bharat@menalto.com> | 2009-11-25 19:26:52 -0800 |
|---|---|---|
| committer | Bharat Mediratta <bharat@menalto.com> | 2009-11-25 19:26:52 -0800 |
| commit | 0121bfd5850bdc59bf0cd656c61c953421a85890 (patch) | |
| tree | 439172283f1ae2653407af2b38a3a57895adf104 /modules/gallery/models | |
| parent | 0ef6994f23300f3c6bfb83193b4101202dbc16f8 (diff) | |
ORM::orderby -> ORM::order_by
Diffstat (limited to 'modules/gallery/models')
| -rw-r--r-- | modules/gallery/models/item.php | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/modules/gallery/models/item.php b/modules/gallery/models/item.php index bd1f9af5..1efac37f 100644 --- a/modules/gallery/models/item.php +++ b/modules/gallery/models/item.php @@ -291,7 +291,7 @@ class Item_Model extends ORM_MPTT { ->where("left_ptr <=", $this->left_ptr) ->where("right_ptr >=", $this->right_ptr) ->where("id <>", 1) - ->orderby("left_ptr", "ASC") + ->order_by("left_ptr", "ASC") ->get() as $row) { // Don't encode the names segment $names[] = rawurlencode($row->name); @@ -460,7 +460,7 @@ class Item_Model extends ORM_MPTT { ->where("parent_id", $this->id) ->where($sort_column, $child->$sort_column) ->where($where) - ->orderby(array("id" => "ASC")) + ->order_by(array("id" => "ASC")) ->get() as $row) { $position++; if ($row->id == $child->id) { @@ -475,10 +475,10 @@ class Item_Model extends ORM_MPTT { // // Reproduce the children() functionality here using Database directly to avoid loading the // whole ORM for each row. - $orderby = array($this->sort_column => $this->sort_order); + $order_by = array($this->sort_column => $this->sort_order); // Use id as a tie breaker if ($this->sort_column != "id") { - $orderby["id"] = "ASC"; + $order_by["id"] = "ASC"; } $position = 0; @@ -486,7 +486,7 @@ class Item_Model extends ORM_MPTT { ->from("items") ->where("parent_id", $this->id) ->where($where) - ->orderby($orderby) + ->order_by($order_by) ->get() as $row) { $position++; if ($row->id == $child->id) { @@ -592,18 +592,18 @@ class Item_Model extends ORM_MPTT { * @param integer SQL limit * @param integer SQL offset * @param array additional where clauses - * @param array orderby + * @param array order_by * @return array ORM */ - function children($limit=null, $offset=0, $where=array(), $orderby=null) { - if (empty($orderby)) { - $orderby = array($this->sort_column => $this->sort_order); + function children($limit=null, $offset=0, $where=array(), $order_by=null) { + if (empty($order_by)) { + $order_by = array($this->sort_column => $this->sort_order); // Use id as a tie breaker if ($this->sort_column != "id") { - $orderby["id"] = "ASC"; + $order_by["id"] = "ASC"; } } - return parent::children($limit, $offset, $where, $orderby); + return parent::children($limit, $offset, $where, $order_by); } /** @@ -617,14 +617,14 @@ class Item_Model extends ORM_MPTT { * @param array additional where clauses * @return object ORM_Iterator */ - function descendants($limit=null, $offset=0, $where=array(), $orderby=null) { - if (empty($orderby)) { - $orderby = array($this->sort_column => $this->sort_order); + function descendants($limit=null, $offset=0, $where=array(), $order_by=null) { + if (empty($order_by)) { + $order_by = array($this->sort_column => $this->sort_order); // Use id as a tie breaker if ($this->sort_column != "id") { - $orderby["id"] = "ASC"; + $order_by["id"] = "ASC"; } } - return parent::descendants($limit, $offset, $where, $orderby); + return parent::descendants($limit, $offset, $where, $order_by); } } |
