diff options
Diffstat (limited to 'core/libraries/ORM_MPTT.php')
-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; } |