16311632
199
     */
199
     */
200
    public function getDescendants($direction = 'ASC', $direct_children_only = false, $limit = false)
200
    public function getDescendants($direction = 'ASC', $direct_children_only = false, $limit = false)
201
    {
201
    {
202
        $query = $this->getTable()->getDatabase()->getQuery();
202
        $query = $this->getService('koowa:database.query.select')
203
 
203
            ->where($this->_left_column, '>', $this->left)
204
        $query = $query->where($this->_left_column, '>', $this->left)
204
            ->where($this->_right_column, '<', $this->right)
205
                ->where($this->_right_column, '<', $this->right)
205
            ->order($this->_left_column, $direction);
206
                ->order($this->_left_column, $direction);
 
 
207
 
206
 
208
        if ($direct_children_only)
207
        if ($direct_children_only)
209
        {
208
        {
...
 
...
 
243
     */
242
     */
244
    public function getParents($direction = 'ASC')
243
    public function getParents($direction = 'ASC')
245
    {
244
    {
246
        $query = $this->getTable()->getDatabase()->getQuery()
245
        $query = $this->getService('koowa:database.query.select')
247
            //->where($this->_level_column, '<>', 0)
246
            //->where($this->_level_column, '<>', 0)
248
            ->where($this->_left_column, '<=', $this->left)
247
            ->where($this->_left_column, '<=', $this->left)
249
            ->where($this->_right_column, '>=', $this->right)
248
            ->where($this->_right_column, '>=', $this->right)