Exemple #1
0
 /**
  * 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   array    additional where clauses
  * @return object ORM_Iterator
  */
 function descendants($limit = null, $offset = 0, $where = array(), $orderby = null)
 {
     if (empty($orderby)) {
         $orderby = array($this->sort_column => $this->sort_order);
         // Use id as a tie breaker
         if ($this->sort_column != "id") {
             $orderby["id"] = "ASC";
         }
     }
     return parent::descendants($limit, $offset, $where, $orderby);
 }
Exemple #2
0
 /**
  * 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   array    additional where clauses
  * @return object ORM_Iterator
  */
 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);
 }
Exemple #3
0
 /**
  * Return all of the children of the specified type, ordered by the defined sort order.
  * @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));
 }