(non-PHPdoc)

@see \Core\Data\Db\TableInfoInterface::listTblColumns()
963010
public function loadColumns($tbl)
    {
        $this->db->sql('SHOW FIELDS FROM `' . $tbl . '`');
        $result = $this->db->all();
        
        $columns = [];
        
        foreach ($result as $row) {
            
            $name = $row['Field'];
            $null = $row['Null'] != 'YES' ? false : true;
            $default = isset($row['Default']) ? $row['Default'] : null;
            $unsigned = false;
            
            // Is column auto increment?
            $auto = strpos($row['Extra'], 'auto_increment') !== false ? true : false;
            
            // Size of field?
            if (preg_match('~(.+?)\s*\((\d+)\)(?:(?:\s*)?(unsigned))?~i', $row['Type'], $matches) === 1) {
                
                $type = $matches[1];
                $size = $matches[2];
                
                if (!empty($matches[3]) && $matches[3] == 'unsigned') {
                    $unsigned = true;
                }
            }
            else {
                $type = $row['Type'];
                $size = null;
            }
            
            $this->addColumn($name, $null, $default, $type, $size, $auto, $unsigned);
        }
    }
1057138
private function getColumns()
    {
        $columns = array();
        
        /**
         * Use call_user_func to make sure only public vars are returned
         */
        $vars = call_user_func('get_object_vars', $this);
        
        foreach ( $vars as $key => $value )
        {
            $columns[] = array(
                "name" => $key
            );
        }
        
        return $columns;
    }
288392
public function getColumns()
	{
		$return = $this->columns;

		try {
			$this->getParent();

			if (!$this->getSessionData('_grid_hidden_columns_manipulated', false)) {
				$columns_to_hide = [];

				foreach ($this->columns as $key => $column) {
					if ($column->getDefaultHide()) {
						$columns_to_hide[] = $key;
					}
				}

				if (!empty($columns_to_hide)) {
					$this->saveSessionData('_grid_hidden_columns', $columns_to_hide);
					$this->saveSessionData('_grid_hidden_columns_manipulated', true);
				}
			}

			$hidden_columns = $this->getSessionData('_grid_hidden_columns', []);

			foreach ($hidden_columns as $column) {
				if (!empty($this->columns[$column])) {
					$this->columns_visibility[$column] = [
						'visible' => false,
					];

					unset($return[$column]);
				}
			}

		} catch (DataGridHasToBeAttachedToPresenterComponentException $e) {
		}

		return $return;
	}
798449
public function getColumns()
    {
        if (!$this->columns && $this->length()) {
            if ($this->first() instanceof DataInterface) {
                $this->columns = array_keys($this->first()->toArray());
            } elseif (is_array($this->first())) {
                $this->columns = array_keys($this->first());
            }
        }

        return $this->columns;
    }
556048
public function getColumns()
    {
        $columns = ArrayList::create();
        
        foreach ($this->getEnabledChildren() as $child) {
            
            $columns->push(
                ArrayData::create([
                    'Child' => $child,
                    'ColumnClass' => $this->ColumnClass
                ])
            );
            
        }
        
        return $columns;
    }
903733
private function getDatatableColumns(): array
    {
        $result = $this->getDisplayColumns();

        if (!$this->getGroupByField()) {
            $result[] = Utility::MENU_PROPERTY_NAME;
        }

        if (!$this->getGroupByField() && $this->batch) {
            $table = TableRegistry::get($this->entity->get('model'));
            // add primary key in FIRST position
            foreach ((array)$table->getPrimaryKey() as $primaryKey) {
                array_unshift($result, $table->aliasField($primaryKey));
            }
        }

        return $result;
    }
1374174
public function getColumnSettings($columns = null)
	{
		if(null == $columns)
		{
			$columns = array_map(function($descriptor)
				{
					return zend_column_name($descriptor);
				},
				$this->getColumns()
			);
		}

		$k = array_find_key($columns, function($v, $k){
				return $v == $this->getPrimaryKey();
			}
		);

		if(null !== $k)
		{
			unset($columns[$k]);
		}

		return  array_join($columns, $this->_settings, false);

	}
762714
protected function getActualColumns($refresh = false)
  {
    if (is_null($this->actual_columns) || $refresh) {
      $m = $this->getManager();

      $q = 'SHOW COLUMNS FROM `' . $m->getPrefix() . $this->getTable() . '`';

      $this->actual_columns = false;

      if ($res = $m->query($q)->fetchAll(\PDO::FETCH_ASSOC)) {
        foreach ($res as $row) {
          $this->actual_columns[] = $row['Field'];
        }
      }
    }

    return $this->actual_columns;
  }
471915
private function prepareColumns()
    {
        $columns = [];
        $hasId = false;
        foreach ($this->columns as $column) {
            if ($column['name'] === 'id') {
                $hasId = true;
            }
            if (!$column['label']) {
                continue;
            }
            $columnType = null;
            array_push($columns, [
                'name'  => $column['name'],
                'label' => $column['label'],
            ]);
        }
        if (!$hasId) {
            array_unshift($columns, [
                'name'  => 'id',
                'label' => 'ID'
            ]);
        }
        return $columns;
    }
910797
private function getSttyColumns()
    {
        if (!function_exists('proc_open')) {
            return null;
        }

        $spec = [
            1 => ['pipe', 'w'],
            2 => ['pipe', 'w'],
        ];

        $process = proc_open('stty -a | grep columns', $spec, $pipes, null, null, ['suppress_errors' => true]);
        if (is_resource($process)) {
            $info = stream_get_contents($pipes[1]);
            fclose($pipes[1]);
            fclose($pipes[2]);
            proc_close($process);

            return $info;
        }

        return null;
    }
617163
protected function getSearchableColumns()
    {
        $columns = $this->getColumns();
        $searchable = [];

        foreach ($columns as $column) {
            if (!$column->searchable) {
                continue;
            }

            $searchable[] = $column;
        }

        return $searchable;
    }
1154177
protected function getListColumnStrategyInstances()
    {
        $instances = [];

        $info = $this->getModelInformation();

        foreach ($info->list->columns as $key => $data) {

            $instance = $this->getListDisplayFactory()->make($data->strategy);

            // Feed any extra information we can gather to the instance
            $instance
                ->setListInformation($data)
                ->setOptions($data->options());

            if ($data->source) {
                if (isset($info->attributes[ $data->source ])) {
                    $instance->setAttributeInformation(
                        $info->attributes[ $data->source ]
                    );
                }
            }

            $instance->initialize($info->modelClass());

            $instances[ $key ] = $instance;
        }

        return $instances;
    }
942253
protected function getSelectedWithColumns()
    {
        $result = [];
        foreach ($this->withFields as $fieldSourceAlias => $withInfo) {
            list ($collection, $fields) = $withInfo;
            $resolvedFields = $this->resolveSelectiveFields($collection, $fields, []);
            $result = array_merge($result, $this->getSelectedColumns($resolvedFields, $fieldSourceAlias));
        }

        return $result;
    }
576991
public function getVisibleColumns()
    {
        $definitions = $this->defineListColumns();
        $columns = [];

        /*
         * Supplied column list
         */
        if ($this->columnOverride === null) {
            $this->columnOverride = $this->getSession('visible', null);
        }

        if ($this->columnOverride && is_array($this->columnOverride)) {

            $invalidColumns = array_diff($this->columnOverride, array_keys($definitions));
            if (!count($definitions)) {
                throw new ApplicationException(Lang::get(
                    'backend::lang.list.missing_column',
                    ['columns'=>implode(',', $invalidColumns)]
                ));
            }

            $availableColumns = array_intersect($this->columnOverride, array_keys($definitions));
            foreach ($availableColumns as $columnName) {
                $definitions[$columnName]->invisible = false;
                $columns[$columnName] = $definitions[$columnName];
            }
        }
        /*
         * Use default column list
         */
        else {
            foreach ($definitions as $columnName => $column) {
                if ($column->invisible) {
                    continue;
                }

                $columns[$columnName] = $definitions[$columnName];
            }
        }

        return $this->visibleColumns = $columns;
    }
517645
public function listCommand($services = [], $table_pattern = '')
    {
        foreach ($services ?: $this->_getDbServices() as $service) {
            /** @var \ManaPHP\DbInterface $db */
            $db = $this->_di->getShared($service);

            $this->console->writeLn(['service: `:service`', 'service' => $service], Console::FC_CYAN);
            foreach ($this->_getTables($service, $table_pattern) as $row => $table) {
                $columns = (array)$db->getMetadata($table)[Db::METADATA_ATTRIBUTES];
                $primaryKey = $db->getMetadata($table)[Db::METADATA_PRIMARY_KEY];
                foreach ($columns as $i => $column) {
                    if (in_array($column, $primaryKey, true)) {
                        $columns[$i] = $this->console->colorize($column, Console::FC_RED);
                    }
                }

                $this->console->writeLn([' :row :table(:columns)',
                    'row' => sprintf('%2d ', $row + 1),
                    'table' => $this->console->colorize($table, Console::FC_GREEN),
                    'columns' => implode(', ', $columns)]);
            }
        }
    }
254240
public function getTableList()
	{
		$this->connect();

		/* @type  SqliteQuery  $query */
		$query = $this->getQuery(true);

		$type = 'table';

		$query->select('name');
		$query->from('sqlite_master');
		$query->where('type = :type');
		$query->bind(':type', $type);
		$query->order('name');

		$this->setQuery($query);

		$tables = $this->loadColumn();

		return $tables;
	}
360946
public function getColumns ($db, $table)
	{
		
		// Get columns
		
		if (!isset ($this->columns[$db][$table]))
		{
			$this->columns[$db][$table]	= $this->db->query ('SHOW COLUMNS FROM ' . $db . '.' . $table)->fetchAll (\PDO::FETCH_NUM);
		}
		
		// Return columns
		
		return $this->columns[$db][$table];
		
	}