From ef0bb33a9531a02c36c99f98b088e544bc6cbd52 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Wed, 5 Nov 2008 01:40:41 +0000 Subject: Order the children() --- core/libraries/ORM_MPTT.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'core') 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; } -- cgit v1.2.3