summaryrefslogtreecommitdiff
path: root/modules/gallery/models
diff options
context:
space:
mode:
authorTim Almdal <tnalmdal@shaw.ca>2009-08-05 07:38:35 -0700
committerTim Almdal <tnalmdal@shaw.ca>2009-08-05 07:38:35 -0700
commit187d4b209d6bd3fce2fa81a88e31f587d9eb4624 (patch)
tree615421464fb2fdcfc9c35d74e338a3c97e9e459c /modules/gallery/models
parent2f63a5379f668188d4e1a46231246a25445e40fa (diff)
Change the children methods on Item_Core and ORM_MPTT in order to
specify a type parameter, so tht we can filter the children based on type (i.e. album, photo, etc). In addition, expose the sort order, so that we can specify the order we want to return the children.
Diffstat (limited to 'modules/gallery/models')
-rw-r--r--modules/gallery/models/item.php9
1 files changed, 7 insertions, 2 deletions
diff --git a/modules/gallery/models/item.php b/modules/gallery/models/item.php
index f3e6b8f3..3498e0db 100644
--- a/modules/gallery/models/item.php
+++ b/modules/gallery/models/item.php
@@ -526,10 +526,15 @@ class Item_Model extends ORM_MPTT {
* @chainable
* @param integer SQL limit
* @param integer SQL offset
+ * @param string type to return
+ * @param array orderby
* @return array ORM
*/
- function children($limit=null, $offset=0) {
- return parent::children($limit, $offset, array($this->sort_column => $this->sort_order));
+ function children($limit=null, $offset=0, $type=null, $orderby=null) {
+ if (empty($orderby)) {
+ $orderby = array($this->sort_column => $this->sort_order);
+ }
+ return parent::children($limit, $offset, $type, $orderby);
}
/**