diff options
| author | Tim Almdal <tnalmdal@shaw.ca> | 2009-08-05 10:45:38 -0700 | 
|---|---|---|
| committer | Tim Almdal <tnalmdal@shaw.ca> | 2009-08-05 10:45:38 -0700 | 
| commit | fb4bfa5711f6db61205b58628ec978b68c3d36df (patch) | |
| tree | 7f079a6e7e934fa302cd8bca19e80f8d7a44a3dd /modules/gallery/models | |
| parent | 63f3efef37839ffba8cd75b9098d56cd03b06376 (diff) | |
| parent | e8c57290a2e98e3cbb7cf47875e6e5dae2e41fa2 (diff) | |
Merge branch 'master' of git://github.com/gallery/gallery3
Diffstat (limited to 'modules/gallery/models')
| -rw-r--r-- | modules/gallery/models/item.php | 25 | 
1 files changed, 16 insertions, 9 deletions
| diff --git a/modules/gallery/models/item.php b/modules/gallery/models/item.php index 3498e0db..c4b9826f 100644 --- a/modules/gallery/models/item.php +++ b/modules/gallery/models/item.php @@ -521,31 +521,38 @@ class Item_Model extends ORM_MPTT {    }    /** -   * Return all of the children of this node, ordered by the defined sort order. +   * Return all of the children of this album.  Unless you specify a specific sort order, the +   * results will be ordered by this album's sort order.     *     * @chainable     * @param   integer  SQL limit     * @param   integer  SQL offset -   * @param   string   type to return +   * @param   array    additional where clauses     * @param   array    orderby     * @return array ORM     */ -  function children($limit=null, $offset=0, $type=null,  $orderby=null) { +  function children($limit=null, $offset=0, $where=array(), $orderby=null) {      if (empty($orderby)) {        $orderby = array($this->sort_column => $this->sort_order);      } -    return parent::children($limit, $offset, $type, $orderby); +    return parent::children($limit, $offset, $where, $orderby);    }    /** -   * Return all of the children of the specified type, ordered by the defined sort order. +   * Return the children of this album, and all of it's sub-albums.  Unless you specify a specific +   * sort order, the results will be ordered by this album's sort order.  Note that this +   * album's sort order is imposed on all sub-albums, regardless of their sort order. +   * +   * @chainable     * @param   integer  SQL limit     * @param   integer  SQL offset -   * @param   string   type to return +   * @param   array    additional where clauses     * @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)); +  function descendants($limit=null, $offset=0, $where=array(), $orderby=null) { +    if (empty($orderby)) { +      $orderby = array($this->sort_column => $this->sort_order); +    } +    return parent::descendants($limit, $offset, $where, $orderby);    }  } | 
