diff options
author | Bharat Mediratta <bharat@menalto.com> | 2008-11-05 01:40:41 +0000 |
---|---|---|
committer | Bharat Mediratta <bharat@menalto.com> | 2008-11-05 01:40:41 +0000 |
commit | ef0bb33a9531a02c36c99f98b088e544bc6cbd52 (patch) | |
tree | 3e2122a2d36e60a1b952d370b061973580755ef7 | |
parent | 190b4398074cc18a1b1c0b3a2640122bce3d9083 (diff) |
Order the children()
-rw-r--r-- | core/libraries/ORM_MPTT.php | 6 |
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; } |