@param string $class
@param array  $columns

@return mixed
352149
protected function constraint($class, array $columns)
    {
        $constraint = new $class($this->getBuilder(), $columns);

        $this->queue($constraint);

        return $constraint;
    }
759864
public function withColumns(array $columns): self
    {
        $selector = clone $this;
        $selector->loader = $selector->loader->withColumns($columns);

        return $selector;
    }
485195
public static function parseRelationClass($class)
    {
        // detect many many through syntax
        if (is_array($class)
            && array_key_exists('through', $class)
            && array_key_exists('to', $class)
        ) {
            $toRelation = $class['to'];

            $hasOne = Config::inst()->get($class['through'], 'has_one');
            if (empty($hasOne) || !is_array($hasOne) || !array_key_exists($toRelation, $hasOne)) {
                return $class;
            }

            return $hasOne[$toRelation];
        }

        return $class;
    }
28416
public function getEntityListColumnType($columnTypeClass)
    {
        if (isset($this->columnTypes[$columnTypeClass])) {
            return $this->columnTypes[$columnTypeClass];
        }
        elseif (class_exists($columnTypeClass)) {
            return new $columnTypeClass();
        }
    }
15224
public function havingMultiple(array $columns)
    {
        $instance = $this->havingStrategyInstance();

        $instance->havingStrategy()->havingMultiple($columns);

        return $instance;
    }
451957
function setColumns($columns) {
		$this->columns = array();

		if ($columns === null) {
			return $this;
		}

		if (is_string($columns)) {
			return $this->addColumn($columns);
		}

		foreach ($columns as $alias => &$column) {
			$this->addColumn($column, is_int($alias) ? null : $alias);
		}
		return $this;
	}
309307
public function select($columns = [])
    {
        $expr = new ColumnExpression($this->sql);

        if ($columns instanceof Closure) {
            $columns($expr);
        } else {
            if (!is_array($columns)) {
                $columns = [$columns];
            }
            $expr->columns($columns);
        }
    }
917408
public function get($columns = array('*'))
    {
        if (! is_null($this->cacheMinutes)) return $this->getCached($columns);

        return $this->getFresh($columns);
    }
1191906
public function get($columns = ['*'])
    {
        $columns = $this->query->getQuery()->columns ? [] : $columns;

        if ($columns === ['*']) {
            $columns = [$this->related->getTable().'.*'];
        }

        $columns[] = $this->getQualifiedFirstLocalKeyName().' as '.static::THROUGH_KEY;

        $this->query->addSelect($columns);

        return $this->query->get();
    }
840842
protected function selectColumnsFromTable(SQLSelect &$query, $tableClass, $columns = null)
    {
        // Add SQL for multi-value fields
        $schema = DataObject::getSchema();
        $databaseFields = $schema->databaseFields($tableClass, false);
        $compositeFields = $schema->compositeFields($tableClass, false);
        unset($databaseFields['ID']);
        foreach ($databaseFields as $k => $v) {
            if ((is_null($columns) || in_array($k, $columns)) && !isset($compositeFields[$k])) {
                // Update $collidingFields if necessary
                $expressionForField = $query->expressionForField($k);
                $quotedField = $schema->sqlColumnForField($tableClass, $k);
                if ($expressionForField) {
                    if (!isset($this->collidingFields[$k])) {
                        $this->collidingFields[$k] = array($expressionForField);
                    }
                    $this->collidingFields[$k][] = $quotedField;
                } else {
                    $query->selectField($quotedField, $k);
                }
            }
        }
        foreach ($compositeFields as $k => $v) {
            if ((is_null($columns) || in_array($k, $columns)) && $v) {
                $tableName = $schema->tableName($tableClass);
                $dbO = Injector::inst()->create($v, $k);
                $dbO->setTable($tableName);
                $dbO->addToQuery($query);
            }
        }
    }
916838
public function get($columns = ['*'])
    {
        if (! is_null($this->minutes)) {
            return $this->getCached($columns);
        }

        return parent::get($columns);
    }
98820
public function remove_column($class)
    {
        // Remove the header
        foreach ($this->header as $index => $header){
            if ($header->attrib['class'] == $class){
                unset($this->header[$index]);
                break;
            }
        }

        // Remove cells from rows
        foreach ($this->rows as $i => $row){
            foreach ($row->cells as $j => $cell){
                if ($cell->attrib['class'] == $class){
                    unset($this->rows[$i]->cells[$j]);
                    break;
                }
            }
        }
    }
1082579
public function columns(string $column, string ...$columns)
    {
        array_unshift($columns, $column);

        foreach ($columns as $column) {
            $this->column($column);
        }

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

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

        return $this->getModelObjects($data);
    }
614131
public function getFresh($columns = [])
    {
        $this->compileOrders();
        $this->compileWheres();

        if ($this->offset) {
            $this->query->skip($this->offset);
        }
        if ($this->limit) {
            $this->query->limit($this->limit);
        }
        if ($this->columns) {
            $columns = $this->columns;
        }

        if (!empty($columns) && $columns[0] != '*') {
            $this->query->pluck($columns);
        }

        $results = $this->query->run();
        if (is_object($results)) {
            $results = $results->toArray();
        }

        if (isset($results['$reql_type$'])
            && $results['$reql_type$'] === 'GROUPED_DATA') {
            return $results['data'];
        }

        return $results;
    }
855306
public function getCached($columns = array('*'))
    {
        if (is_null($this->columns)) $this->columns = $columns;

        //
        list($key, $minutes) = $this->getCacheInfo();

        $cache = $this->getCache();

        $callback = $this->getCacheCallback($columns);

        if ($minutes < 0) {
            return $cache->rememberForever($key, $callback);
        }

        return $cache->remember($key, $minutes, $callback);
    }
1222792
public static function getRealType($class) {
        $callback = function () use ($class) {
            $instance = new \ReflectionClass($class);
            $doc = $instance->getDocComment();
            unset($instance);
            preg_match_all('/\@property\s+([a-z]+)\s+\$([a-z\d_]+)/i', $doc, $matches, PREG_SET_ORDER);
            return array_column($matches, 1, 2);
        };
        if (app()->isDebug()) {
            return $callback();
        }
        return cache()->getOrSet('class_doc_type:'.$class, $callback, 86400);
    }