diff options
author | Tim Almdal <tnalmdal@shaw.ca> | 2009-03-09 14:38:25 +0000 |
---|---|---|
committer | Tim Almdal <tnalmdal@shaw.ca> | 2009-03-09 14:38:25 +0000 |
commit | b9ee37f30effee856dc963b38751f3e904fd8ddf (patch) | |
tree | 3d7b4360923923e4972029c156281df9c4c6daaa /core/models | |
parent | ac82e0a9dff9511eaf97bb7fc6f25add762583a4 (diff) |
Override the ORM_MTTP::children and ORM_MTPP::descendants methods in
the item model and always pass the orderby fields. This insures that
all children or descendant calls will respect the album sort order.
Diffstat (limited to 'core/models')
-rw-r--r-- | core/models/item.php | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/core/models/item.php b/core/models/item.php index 9f9134fa..bab83aca 100644 --- a/core/models/item.php +++ b/core/models/item.php @@ -353,4 +353,29 @@ class Item_Model extends ORM_MPTT { url::abs_file("lib/flowplayer-3.0.5.swf") . "'); </script>"; } + + /** + * Return all of the children of this node, ordered by id. + * + * @chainable + * @param integer SQL limit + * @param integer SQL offset + * @return array ORM + */ + function children($limit=null, $offset=0) { + return parent::children($limit, $offset, array($this->sort_column => $this->sort_order)); + } + + /** + * Return all of the children of the specified type, ordered by id. + * + * @param integer SQL limit + * @param integer SQL offset + * @param string type to return + * @return object ORM_Iterator + */ + function descendants($limit=null, $offset=0, $type=null) { + return parent::descendants($limit, $offset, $type, + array($this->sort_column => $this->sort_order)); + } } |