Sets the column layout for the options
@param array $cols An array of column_name => span_length pairs
@see  $columnCounts

@return   OptionsetField
432364
public function setColumns($cols) {
		if(!is_array($cols)) {
			throw new Exception("BootstrapOptionsetField::setColumns must be passed an array.");
		}

		$allowed_keys = array('lg','md','sm','xs');
		$diff = array_diff($allowed_keys, array_keys($cols));
		if(!empty($diff)) {
			throw new Exception("BootstrapOptionsetField::setColumns must be passed an array with keys " . implode(', ', $allowed_keys));
		}

		$this->columnCounts = $cols;

		$maxSpan = max(array_values($this->columnCounts));
		$minSpan = min(array_values($this->columnCounts));
		$this->numberOfColumns = ceil($maxSpan/$minSpan);

		return $this->owner;
	}
723388
public function columns($columns)
	{
		if ($this->columns === null)
		{
			$this->columns = new Query\QueryElement('()', $columns);
		}
		else
		{
			$this->columns->append($columns);
		}

		return $this;
	}
490414
public function addColumns(array $columns) : Table
    {
        foreach ($columns as $column => $definition) {
            if (is_numeric($column) && is_string($definition)) {
                $this->addColumn($definition, []);
            } else {
                $this->addColumn($column, $definition);
            }
        }
        return $this;
    }
63589
public function setColumnNames(array $columnNames)
    {
        $this->columnNames = array();

        foreach ($columnNames as $columnName) {
            $this->addColumnName($columnName);
        }
    }
781137
public function setColumns(array $columns)
    {
        foreach ($columns as $column) {
            $this->columns->push($column);
        }

        return $this;
    }
680055
public function setColumns($columns)
    {
        $columns = is_array($columns) ? $columns : func_get_args();

        if (count($columns) > 0) {
            $this->columns = implode(', ', $columns);
        }
    }
677046
public function withColumnsButIgnoringConstraints(array $columns) : Table
    {
        if ($this->columns === $columns) {
            return $this;
        }

        return new self($this->name, $columns);
    }
312048
public function orColumns(array $columns)
    {
        foreach ($columns as $column => $value) {
            $this->orColumn($column, $value);
        }

        return $this;
    }
1087280
protected function multipleCol(array $cols, /*# bool */ $rawMode)
    {
        foreach ($cols as $key => $val) {
            if (is_int($key)) {
                $this->realCol($val, '', $rawMode);
            } else {
                $this->realCol($key, $val, $rawMode);
            }
        }
    }
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;
	}
1075099
public function select($cols = '*')
    {
        $this->type = 'SELECT';
        if (!is_array($cols)) {
            $cols = array($cols);
        }
        $this->cols($cols);
        return $this;
    }
1049347
public function setHiddenColumns( $columns )
    {
        $this->hiddenColumns = array();

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

        return $this;
    }
830663
public function addIndex($columns, $options = [])
    {
        // create a new index object if strings or an array of strings were supplied
        if (!$columns instanceof Index) {
            $index = new Index();
            if (is_string($columns)) {
                $columns = [$columns]; // str to array
            }
            $index->setColumns($columns);
            $index->setOptions($options);
        } else {
            $index = $columns;
        }

        $this->indexes[] = $index;

        return $this;
    }
396371
public function setColumns(array $columns, $add = false) {
        if (!$add) {
            $this->columnDefinition = [];
        }
        foreach ($columns as $key => $def) {
            $this->addColumn($key, $def);
        }
        return $this;
    }
321035
public function setColumns(array $columns)
    {
        $useColumns = [];

        foreach ($columns as $col) {
            $col = $this->createColumn($col);
            $useColumns[$col->getUniqueId()] = $col;
        }

        $this->columns = $useColumns;
    }
455856
public function columns($columns)
    {
        if (is_string($columns)) {
            $columns = preg_split('~\s*,\s*~', trim($columns));
        }

        $this->columns = $columns;

        return $this;
    }
297328
public function cols( array $cols ) : array {

		// This function gets called multiple times, so let's cache it for efficiency:
		if ( isset( $this->the_cols ) ) {
			return $this->the_cols;
		}

		$new_cols = [];
		$keep = [
			'cb',
			'title',
		];

		# Add existing columns we want to keep:
		foreach ( $cols as $id => $title ) {
			if ( in_array( $id, $keep, true ) && ! isset( $this->args['admin_cols'][ $id ] ) ) {
				$new_cols[ $id ] = $title;
			}
		}

		# Add our custom columns:
		foreach ( array_filter( $this->args['admin_cols'] ) as $id => $col ) {
			if ( is_string( $col ) && isset( $cols[ $col ] ) ) {
				# Existing (ie. built-in) column with id as the value
				$new_cols[ $col ] = $cols[ $col ];
			} elseif ( is_string( $col ) && isset( $cols[ $id ] ) ) {
				# Existing (ie. built-in) column with id as the key and title as the value
				$new_cols[ $id ] = esc_html( $col );
			} elseif ( 'author' === $col ) {
				# Automatic support for Co-Authors Plus plugin and special case for
				# displaying author column when the post type doesn't support 'author'
				if ( class_exists( 'coauthors_plus' ) ) {
					$k = 'coauthors';
				} else {
					$k = 'author';
				}
				$new_cols[ $k ] = esc_html__( 'Author', 'extended-cpts' );
			} elseif ( is_array( $col ) ) {
				if ( isset( $col['cap'] ) && ! current_user_can( $col['cap'] ) ) {
					continue;
				}
				if ( isset( $col['connection'] ) && ! function_exists( 'p2p_type' ) ) {
					continue;
				}
				if ( ! isset( $col['title'] ) ) {
					$col['title'] = $this->get_item_title( $col ) ?? $id;
				}
				$new_cols[ $id ] = esc_html( $col['title'] );
			}
		}

		# Re-add any custom columns:
		$custom   = array_diff_key( $cols, $this->_cols );
		$new_cols = array_merge( $new_cols, $custom );

		$this->the_cols = $new_cols;
		return $this->the_cols;

	}