Add multiple columns at a time
@param $columns
@throws ColumnKeyNotProvidedException
483176
protected function addColumns($columns)
    {
        $model = $this->models->first();

        if ($columns) {
            foreach ($columns as $key => $field) {
                if (is_numeric($key)) {
                    // Simple non-keyed array passed.
                    $new_column = Column::create($field);
                } else {
                    // Key also matters, apparently
                    $new_column = Column::create($key, $field);
                }

                $new_column->setOptionsFromModel($model);

                $this->columns[] = $new_column;
            }
        }
    }
1112848
public function addColumn(Column $column)
    {
        $columns = func_get_args();

        foreach ($columns as $column) {
            $this->columns[$column->columnName] = $column;

            if ($column instanceof AutoIncrementColumn) {
                $this->uniqueIdentifierColumnName = $column->columnName;
            }
        }
    }
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;
    }
405413
public function setValues(array $columns)
    {
        $instance = $this->updateQueryInstance();

        $instance->updateQuery()->setMultiple($columns);

        return $instance;
    }
618796
public function setColumnHeaders(array $columnHeaders)
    {
        $this->columnHeaders = array_count_values($columnHeaders);
        $this->headersCount = count($columnHeaders);
    }
343157
protected function parseColumns(string $columns): void
    {
        // Split the columns string into individual columns
        $columns = explode(',', $columns);

        foreach ($columns as &$column) {
            if (strpos($column, '.') === false) {
                $column = "{$this->model->getSource()}.{$column}";
            } else {
                $as = str_replace('.', '_', $column);
                $column = "{$column} {$as}";
            }
        }

        $this->columns = implode(', ', $columns);
    }
1126141
public function columns($columns) {
		foreach ($columns as $property => $definition) {
			if (is_bool($definition)) {
				$this->_properties[$property] = $definition;
				continue;
			}
			
			$this->addAccumulator($property, $definition);
		}
		
		return $this;
	}
200571
public function define_columns($columns) {
        parent::define_columns($columns);
        foreach ($this->columns as $column => $column) {
            // Automatically assign classes to columns.
            $this->column_class[$column] = ' ' . $column;
        }
    }
769049
public function setColumns(array $columns): self
    {
        foreach ($columns as $column => list($type, $size)) {
            list($type, $size) = $this->validateColumn($type, $size);
            $columns[$column] = [$type, $size];
        }
        $this->columns = $columns;
        return $this;
    }
63589
public function setColumnNames(array $columnNames)
    {
        $this->columnNames = array();

        foreach ($columnNames as $columnName) {
            $this->addColumnName($columnName);
        }
    }
1233653
protected function generateDocBlock(array $columns): void
  {
    $this->codeStore->append('/**');
    $this->codeStore->append(' * @todo describe routine', false);
    $this->codeStore->append(' * ', false);

    $padding = $this->getMaxColumnLength($columns);
    $format  = sprintf(' * @param p_%%-%ds @todo describe parameter', $padding);
    foreach ($columns as $column)
    {
      $this->codeStore->append(sprintf($format, $column['column_name']), false);
    }

    $this->codeStore->append(' */', false);
  }
1145857
public function setSortableColumns($columns)
    {
        if (!empty($this->columns()->sortable)) {
            $columns = array_merge($columns, $this->columns()->sortable);
        }

        return $columns;
    }
396371
public function setColumns(array $columns, $add = false) {
        if (!$add) {
            $this->columnDefinition = [];
        }
        foreach ($columns as $key => $def) {
            $this->addColumn($key, $def);
        }
        return $this;
    }
1166410
public function setColumns($columns)
    {
        if (is_string($columns)) {
            $columns = explode(',', $columns);
            $columns = ArrayMethods::trim($columns);
        }
        return $this->setColumnNames($columns);
    }
1057252
public function setColumns($columns)
    {
        foreach ($columns as $c) {
            $this->setColumn($c, isset($c['show']) ? $c['show'] : true);
        }

        return $this;
    }
746190
public function columns(array $columns)
	{
		$columnsArray = array();
		foreach($columns as $column)
		{
			$columnsArray[] = $this->factory->references('Column', $column);
		}
		$this->insert->columns($columnsArray);

		return $this;
	}
1182497
public function addAdminColumns($columns)
    {
        $admin_columns = $this->getAdminColumns();
        $fields = $this->getFields();
        
        foreach ($admin_columns as $k) {
            $field = $fields[$k];
            $columns[$k] = (is_array($field) && array_key_exists('label', $field))
                ? $field['label']
                : Str::human(str_replace('-', ' ', $k));
        }
        return $columns;
    }