src/Franzose/ClosureTable/Models/Entity.php
protected function children($position = null, $order = 'asc')
    {
        $query = $this->queryByParentId();

        if (!is_null($position)) {
            if (is_array($position)) {
                $query->buildWherePosition($this->getPositionColumn(), $position);
            } else {
                if ($position === static::QUERY_LAST) {
                    $query->orderBy($this->getPositionColumn(), 'desc');
                } else {
                    $query->where($this->getPositionColumn(), '=', $position);
                }
            }
        }

        if ($position !== static::QUERY_LAST) {
            $query->orderBy($this->getPositionColumn(), $order);
        }

        return $query;
    }
protected function children($position = null, $order = 'asc')
    {
        $query = $this->queryByParentId();

        if (!is_null($position)) {
            if (is_array($position)) {
                $query->buildWherePosition($this->getPositionColumn(), $position);
            } else {
                if ($position === static::QUERY_LAST) {
                    $query->orderBy($this->getPositionColumn(), 'desc');
                } else {
                    $query->where($this->getPositionColumn(), '=', $position);
                }
            }
        }

        if ($position !== static::QUERY_LAST) {
            $query->orderBy($this->getPositionColumn(), $order);
        }

        return $query;
    }
protected function children ( $ position = null , $ order = 'asc' ) { $ query = $ this -> queryByParentId ( ) ; if ( ! is_null ( $ position ) ) { if ( is_array ( $ position ) ) { $ query -> buildWherePosition ( $ this -> getPositionColumn ( ) , $ position ) ; } else { if ( $ position === static :: QUERY_LAST ) { $ query -> orderBy ( $ this -> getPositionColumn ( ) , 'desc' ) ; } else { $ query -> where ( $ this -> getPositionColumn ( ) , '=' , $ position ) ; } } } if ( $ position !== static :: QUERY_LAST ) { $ query -> orderBy ( $ this -> getPositionColumn ( ) , $ order ) ; } return $ query ; }
Shorthand of the children query part.

@param array|int|null $position
@param string $order
@return QueryBuilder
Shorthand of the children query part .