Set columns option value.

@param array $columns
@return $this
@see https://datatables.net/reference/option/columns
4846
public function columns(array $columns)
    {
        $this->collection = new Collection;

        foreach ($columns as $key => $value) {
            if (! is_a($value, Column::class)) {
                if (is_array($value)) {
                    $attributes = array_merge(
                        [
                            'name' => $value['name'] ?? $value['data'] ?? $key,
                            'data' => $value['data'] ?? $key,
                        ],
                        $this->setTitle($key, $value)
                    );
                } else {
                    $attributes = [
                        'name' => $value,
                        'data' => $value,
                        'title' => $this->getQualifiedTitle($value),
                    ];
                }

                $this->collection->push(new Column($attributes));
            } else {
                $this->collection->push($value);
            }
        }

        return $this;
    }
974789
public function select($columns= '*') {
        if (!is_array($columns)) {
            $columns= trim($columns);
            if ($columns == '*' || $columns === $this->_alias . '.*' || $columns === $this->xpdo->escape($this->_alias) . '.*') {
                $columns= $this->xpdo->getSelectColumns($this->_class, $this->_alias, $this->_alias . '_');
            }
            $columns= explode(',', $columns);
            foreach ($columns as $colKey => $column) $columns[$colKey] = trim($column);
        }
        if (is_array ($columns)) {
            if (!is_array($this->query['columns'])) {
                $this->query['columns']= $columns;
            } else {
                $this->query['columns']= array_merge($this->query['columns'], $columns);
            }
        }
        return $this;
    }
764861
public function cols(array $cols)
    {
        if ($this->type == 'SELECT') {
            foreach ($cols as $key => $val) {
                $this->addColSELECT($key, $val);
            }
            return $this;
        }
        return $this->addCols($cols);
    }
1075099
public function select($cols = '*')
    {
        $this->type = 'SELECT';
        if (!is_array($cols)) {
            $cols = array($cols);
        }
        $this->cols($cols);
        return $this;
    }
672728
public function select($columns)
    {
        if (is_array($columns)) {
            $this->columns = $columns;
        } elseif ($columns === '*') {
            $this->columns = ['*'];
        }
        return $this;
    }
1189527
public function columns(array $columns)
    {
        $this->getColumns()->setColumns($columns);

        $this->manager->columns();

        return $this;
    }
1302294
public function columns($columns) {
        if (is_array($columns)) {
            $this->sql .= '(`' . implode('`, `', $columns) . '`) ';
        } else if (is_string($columns)) {
            $this->sql .= "($columns) ";
        }
        return $this;
    }
787804
public function setColumns(array $columns)
    {
        foreach ($columns as $id => $params) {
            if (!is_string($id) || strlen($id) < 1)
                throw new \Exception("Column ID should be a non-empty string");
            if (!isset($params['title']))
                throw new \Exception("No 'title' param for ID $id");
            if (!isset($params['type']))
                throw new \Exception("No 'type' param for ID $id");
            if (!in_array($params['type'], self::getAvailableTypes()))
                throw new \Exception("Unknown type '" . $params['type'] . "' for ID $id");
            if (!isset($params['filters']))
                throw new \Exception("No 'filters' param for ID $id");
            if (!isset($params['sortable']))
                throw new \Exception("No 'sortable' param for ID $id");
            if (!isset($params['visible']))
                throw new \Exception("No 'visible' param for ID $id");

            foreach ($params['filters'] as $filter) {
                if (!in_array($filter, self::getAvailableFilters()))
                    throw new \Exception("Unknown filter: $filter");
            }
        }

        $this->columns = $columns;
        return $this;
    }
711120
public function targetColumns($columns) {
        $this->targetColumns = is_array($columns) ? $columns : explode(',',
                        $columns);
        return $this;
    }
1111303
public function setColumns( $columns ){
		if( !( is_array( $columns ) && count( $columns ) ) )
			throw new \InvalidArgumentException( 'Column array must not be empty' );
		$this->columns = $columns;
	}
740564
public function addSelect($columns) {
		if(is_array($columns))
			return $this->_addSelect($columns);

		$columns = explode(',', $columns);
		foreach($columns as $columnstr) {
			$columnstr = trim($columnstr);

			preg_match('/(.*?)\s+as\s+([a-z_][a-zA-Z0-9_]*)?$/i', $columnstr, $matches);
			if(isset($matches[2])) {
				$alias = $matches[2];
				$column = $matches[1];
			}
			else
				$alias = $column = $columnstr;

			if(isset($this->columns[$alias]))
				throw new \Exception('Column alias '.$alias.' is already used.');
			$this->columns[$alias] = $column;
		}

		return $this;
	}
900384
public function select($columns)
  {
    $this->type = 'select';

    if ( is_null($this->select) ){
      $this->select = new Element('SELECT', $columns);
    }
    else {
      $this->select->append($columns);
    }

    return $this;
  }
1205812
private function buildColumns(array $columns)
    {
        $this->columns = [];
        foreach ($columns as $key => $column)
        {
            $column = new DataTableColumn($column);
            $this->columns[$key] = $column;
            if($column->getName() != ""){
                $this->columns[$column->getName()] = $column;
            }
            if($column->getData() != ""){
                $this->columns[$column->getData()] = $column;
            }
        }
    }
405735
public function setAddedColumns(array $columns)
    {
        $this->addedColumns = [];
        foreach ($columns as $column) {
            $this->addAddedColumn($column->getName(), $column);
        }
    }
1294133
public function dropColumn($columns)
    {
        $columns = is_array($columns) ? $columns : func_get_args();

        return $this->addCommand('dropColumn', compact('columns'));
    }
252408
public function setColumns(array $columns)
    {
        $defaultColumn = [
            'field'   => 'label',
            'label'   => 'Label',
            'attr'    => [
                'name'  => '',
                'id'    => '',
                'class' => '',
                'width' => '',
                'style' => '',
            ],
            'format'  => 'txt',
            'show'    => true,
            'sorting' => true,
            'hiding'  => true,
            'options' => false,
            'nested'  => false,
        ];

        $this->setPrependColumns();

        foreach ($columns as $key => $column) {
            $column = array_merge($defaultColumn, $column);
            $this->columns[ $key ] = $column;
        }

        $this->setAppendColumns();

        return $this;
    }
1355493
public function multiFilterBy($columns)
    {
        foreach ($columns as $column => $value) {
            if (strpos($column, '.')) {
                $this->filterByRelation($column, $value);
            } else {
                $this->filterBy($column, $value);
            }
        }

        return $this;
    }