Retrieves entire tree.

@param array $columns
@return \Franzose\ClosureTable\Extensions\Collection
193127
public static function getTree(array $columns = ['*'])
    {
        /**
         * @var Entity $instance
         */
        $instance = new static;

        return $instance->orderBy($instance->getParentIdColumn())->orderBy($instance->getPositionColumn())
            ->get($instance->prepareTreeQueryColumns($columns))->toTree();
    }
538884
public function columns($columns)
	{
		if (is_null($this->columns))
		{
			$this->columns = new Query\QueryElement('()', $columns);
		}
		else
		{
			$this->columns->append($columns);
		}

		return $this;
	}
705695
public function columns(array $columns): self
    {
        foreach ($columns as $name => $alias) {
            if (!is_string($name)) {
                $this->column($alias, null);
                continue;
            }
            if (is_string($alias)) {
                $this->column($name, $alias);
            } else {
                $this->column($alias, $name);
            }
        }
        return $this;
    }
653329
public function columns($columns)
    {
        if (!is_array($columns)) {
            $columns = preg_split('~\s*,\s*~', trim($columns));
        }

        $this->columns = $columns;

        return $this;
    }
940439
protected function extractColumns($columns)
    {
        $schema = [];

        foreach ($columns as $name => $data) {
            $schema[$name] = $this->extractColumn($data);
        }

        return $schema;
    }
179596
public function get($columns = ['*'])
    {
        $cacheKey = $this->generateCacheKey();

        if (null === ($results = $this->cache->tags($this->cacheTag)->get($cacheKey))) {
            $results = parent::get($columns);

            if ($this->isTimeAwareQuery) {
                // Cache results for $cacheLifeTime minutes
                $this->cache->tags($this->cacheTag)->put($cacheKey, $results, $this->cacheLifeTime);
            } else {
                // Cache results forever
                $this->cache->tags($this->cacheTag)->forever($cacheKey, $results);
            }
        }


        return $results;
    }
555694
protected function select(array $columns = [])
    {
        $columns = !is_array($columns) ? func_get_args() : $columns;

        if (empty($columns)) {
            $columns = ['*'];
        }

        return static::db()->select($columns)->from($this->table());
    }
158035
public function get($columns = ['*'])
    {
        if ($this->query->from instanceof Subquery) {
            $this->wheresToSubquery($this->query->from);
        }

        return parent::get($columns);
    }
511456
protected function _get($columns = '*')
    {
        $data = $this->db->select($this->table, $columns, $this->where);

        if (empty($data)) {
            return false;
        }

        return $this->getModelObjects($data);
    }
194813
public static function all($column='')
    {
        $instance = new static;

        $result = $instance->newRequest($instance->functionCall,$instance->module);

        $collection = $instance->newCollection();
        foreach($result as $key => $object){
            $collection->put($key, new static((array) $object));
        }
        return $collection;
    }
1136672
public function getDescendantsAndSelf( $columns = ['*'] )
	{
		if ( is_array( $columns ) )
			return $this->descendantsAndSelf()->get( $columns );

		$arguments = func_get_args();

		$limit = intval( array_shift( $arguments ) );
		$columns = array_shift( $arguments ) ?: ['*'];

		return $this->descendantsAndSelf()->limitDepth( $limit )->get( $columns );
	}
765515
public function whereMultiple(array $columns)
    {
        $instance = $this->whereStrategyInstance();

        $instance->whereStrategy()->whereMultiple($columns);

        return $instance;
    }
984057
public function makeAssociativeCollection(array $columns)
    {
        $mapped = [];

        foreach ($columns as $column) {
            Arr::set($mapped, $column->getSlug(), $column);
        }

        return $mapped;
    }
36823
public function select($columns = [])
    {
        $expr = new ColumnExpression($this->getSQLStatement());

        if ($columns instanceof Closure) {
            $columns($expr);
        } else {
            if (!is_array($columns)) {
                $columns = [$columns];
            }
            $expr->columns($columns);
        }
    }
626854
public function columns(array $columns)
    {
        foreach ($columns as $column => $value) {
            $this->column($column, $value);
        }

        return $this;
    }
973364
public function get($columns = array('*'))
	{
		if (!$this->applyMetaFilters()) {
			if (!empty($this->aggregate)) {
				return 0;
			}
			return $this->model->newCollection();
		}
		
		if (!empty($this->aggregate)) {
			return parent::get($columns);
		}
		else {
			$results = parent::get(array('m.xref_id'));
		}
		
		if (empty($results)) {
			return $this->model->newCollection();
		}
		
		$xref_ids = array();
		foreach ($results as $result) {
			if (!isset($result->xref_id)) continue;
			$xref_ids[] = $result->xref_id;
		}
		
		if (empty($xref_ids)) {
			return $this->model->newCollection();
		}
		
		$key = $this->model->getKeyName();
		
		$models = $this->model->newQuery()->whereIn($key, $xref_ids)->get();
		
		$models->sortBy(function ($model) use ($xref_ids, $key) {
			foreach ($xref_ids as $idx => $i) {
				if ($model->{$key} == $i) {
					return $idx;
				}
			}
			return 0;
		});
		
		if (!empty($this->relations)) {
			$models->load($this->relations);
		}
		
		return $models;
	}
741384
public function select($columns = '*')
    {
        settype($columns, 'array');

        $this->columns = array_unique(array_merge($this->columns, $columns));
        return $this;
    }