Decide which columns we want to display.

@return Column\AbstractColumn[]

@throws \Exception
13915
private function getColumnsToDisplay()
    {
        if (is_array($this->columnsToDisplay)) {
            return $this->columnsToDisplay;
        }

        $columnsToDisplay = [];
        foreach ($this->getColumns() as $column) {
            /* @var $column \ZfcDatagrid\Column\AbstractColumn */

            if (! $column instanceof Column\Action && $column->isHidden() === false) {
                $columnsToDisplay[] = $column;
            }
        }
        if (empty($columnsToDisplay)) {
            throw new \Exception('No columns to display available');
        }

        $this->columnsToDisplay = $columnsToDisplay;

        return $this->columnsToDisplay;
    }
670822
protected function setColumns()
    {
        // choose what columns should be displayed in the table.
        // For table display, we need to specify the column name for the result query.

        $this->addCheckableColumn();

        $this->columns['id'] = array(
            'label'         => 'ID',
            'sortable'      => true,
            'table_column'  => 'users.id',
        );

        $this->columns['username'] = array(
            'label'     => 'Username',
            'sortable'  => true,
            'table_column'  => 'users.username',
        );

        $this->columns['email'] = array(
            'label'         => 'Email',
            'sortable'      => true,
            'classes'       => 'some_class some_class2',
            'table_column'  => 'users.email',
            'thead_attr'    => 'style="width:200px" data-some-attr="example"',
        );

        $this->columns['created_at'] = array(
            'label'         => 'Created At',
            'sortable'      => true,
            'table_column'  => 'users.created_at',
        );

        $this->addActionColumn();

    }
1247131
private function getDisplayColumns(): array
    {
        if (! empty($this->displayColumns)) {
            return $this->displayColumns;
        }

        $this->displayColumns = $this->searchData['display_columns'];

        $groupByField = $this->getGroupByField();

        if ($groupByField) {
            list($prefix, ) = pluginSplit($groupByField);
            $countField = $prefix . '.' . Search::GROUP_BY_FIELD;

            $this->displayColumns = [$groupByField, $countField];
        }

        return $this->displayColumns;
    }
315300
public function getTableColumns() : array
    {
        if (!$this->isTableNameSet()) {
            return [];
        }
        
        $sql = "SHOW COLUMNS FROM `".$this->tableName."`";
        $stmt = $this->db->query($sql);
        $arrResult = $stmt->fetchAll(PDO::FETCH_ASSOC);
        return $arrResult;
    }
1143257
private function compileColumnNames()
    {
        $columns = [];
        foreach($this->columnConfiguration as $column) {
            $columns[] = $column->getName();
        }

        return $columns;
    }
192317
private function getColumns()
    {
        $table = $this->table->connect($this->database, Inflector::tabilize($this->tableName));

        return $table->getColumns();
    }
515727
public function getColumnNames()
    {
        $columns = array();
        foreach ($this->childs as $column) {
            $columns[] = $column->getColumnName();
        }

        return $columns;
    }
1259268
public function columns()
    {
        $this->hook->filter(
            "manage_edit-{$this->taxonomy->getModel()->getSlug()}_columns",
            [$this->taxonomy->getColumns(), 'setNames']
        )->dispatch();

        $this->hook->filter(
            "manage_{$this->taxonomy->getModel()->getSlug()}_custom_column",
            function ($value, $name, $id) {
                return $this->taxonomy->getColumn($name)->render($id);
            },
            ['numberOfArguments' => 3]
        )->dispatch();
    }
996116
public function columns() : array
    {
        if ($this->numRows() > 1) {
            return array_map(null, ...$this->samples);
        }

        $n = $this->numColumns();

        $columns = [];

        for ($i = 0; $i < $n; $i++) {
            $columns[] = array_column($this->samples, $i);
        }

        return $columns;
    }
1259760
protected function printColumns()
    {
        return is_array($this->printColumns) ? $this->toColumnsCollection($this->printColumns) : $this->getPrintColumnsFromBuilder();
    }
67241
public function getColumnOptions()
    {
        //make sure we only run this once and then return the cached version
        if (empty($this->columnOptions)) {
            foreach ($this->getColumns() as $column) {
                $this->columnOptions[] = $column->getOptions();
            }
        }

        return $this->columnOptions;
    }
168390
public function columns(): array
    {
        $columns = $this->columns ?: [];

        if ( ! count($columns)) {
            $columns = $this->getGroupContentColumns();
        }

        // If columns are set, fill them out if they don't fit the grid
        if ($remainder = $this->getRemainderForColumns($columns)) {
            $columns[ count($columns) - 1 ] += $remainder;
        }

        return $columns;
    }
81951
public function columns()
    {
        return $this->scaffoldColumns()
                    ->without(['slug'])
                    ->update('title', function (Element $title) {
                        return $title->setStandalone(true);
                    })
                    ->push((new Element('url'))->setTemplate(function ($row) {
                        return link_to($row->url, $row->title, ['target' => '_blank']);
                    }))
                    ->join(['title', 'url'], 'info', 1);
    }
616844
public static function getColumns()
    {
        $cls = get_called_class();
        if (!array_key_exists($cls, self::$_columns)) {
            return null;
        }
        return self::$_columns[$cls];
    }
855618
protected function guessColumns()
    {
        if (empty($this->columns)) {
            $column = [
                'name' => $this->hasModel() ? $this->attribute : $this->name,
                'type' => MultipleInputColumn::TYPE_TEXT_INPUT
            ];

            if ($this->enableGuessTitle && $this->hasModel()) {
                $column['title'] = $this->model->getAttributeLabel($this->attribute);
            }
            $this->columns[] = $column;
        }
    }
1042721
protected function getTotalColumns()
    {
        $columns = $this->visibleColumns ?: $this->getVisibleColumns();
        $total = count($columns);

        if ($this->showCheckboxes) {
            $total++;
        }

        if ($this->showSetup) {
            $total++;
        }

        return $total;
    }
92591
protected function GetColumns()
	{
		if (!$this->ModelName)
		{
			throw new Exception("ModelName must be defined in " . get_class($this) . "::GetColumns");
		}

		$counter = 0;
		$props = array();
		foreach (get_class_vars($this->ModelName)as $var => $val)
		{
			$props[$counter++] = $var;
		}
		return $props;
	}