summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2008-11-05 01:40:41 +0000
committerBharat Mediratta <bharat@menalto.com>2008-11-05 01:40:41 +0000
commitef0bb33a9531a02c36c99f98b088e544bc6cbd52 (patch)
tree3e2122a2d36e60a1b952d370b061973580755ef7
parent190b4398074cc18a1b1c0b3a2640122bce3d9083 (diff)
Order the children()
-rw-r--r--core/libraries/ORM_MPTT.php6
1 files changed, 4 insertions, 2 deletions
diff --git a/core/libraries/ORM_MPTT.php b/core/libraries/ORM_MPTT.php
index 6d3478ad..047e681e 100644
--- a/core/libraries/ORM_MPTT.php
+++ b/core/libraries/ORM_MPTT.php
@@ -97,14 +97,16 @@ class ORM_MPTT_Core extends ORM {
}
/**
- * Return all of the children of this node, unordered.
+ * Return all of the children of this node, ordered by id.
*
* @return array ORM
*/
function children() {
if (!isset($this->children)) {
$this->children =
- $this->where("parent_id", $this->id)->find_all();
+ $this->where("parent_id", $this->id)
+ ->orderby("id", "ASC")
+ ->find_all();
}
return $this->children;
}