Fetch model table columns.

@return void
426957
protected static function loadColumnListing()
    {
        if (empty(static::$columnListing)) {
            $instance = new static;

            static::$columnListing = $instance->getConnection()
                                        ->getSchemaBuilder()
                                        ->getColumnListing($instance->getTable());
        }
    }
980201
protected function getModels()
    {
        if ($this->_models === null) {
            $this->_models = [];
            $timings = $this->calculateTimings();

            foreach ($timings as $seq => $dbTiming) {
                $this->_models[] = [
                    'method' => $this->getRequestMethod($dbTiming['info']),
                    'type' => $this->getRequestType($dbTiming['category']),
                    'request' => $dbTiming['info'],
                    'duration' => ($dbTiming['duration'] * 1000), // in milliseconds
                    'trace' => $dbTiming['trace'],
                    'timestamp' => ($dbTiming['timestamp'] * 1000), // in milliseconds
                    'seq' => $seq,
                ];
            }
        }

        return $this->_models;
    }
937597
public function getModels($columns = array('*'))
    {
        // make sure that we select the version table, if the main table is selected
        $tempColumns = isset($this->query->columns)
            ? array_merge($columns, $this->query->columns)
            : $columns;
        foreach($tempColumns as $column) {
            $segments = explode('.', $column);
            if ($segments[0] == $this->model->getTable()) {
                $this->query->addSelect($this->model->getVersionTable().'.*');
                break;
            }
        }

        return parent::getModels($columns);
    }
720915
private function getColumnTypes(): void
  {
    $rows = DataLayer::getAllTableColumns();
    foreach ($rows as $row)
    {
      $key = '@'.$row['table_name'].'.'.$row['column_name'].'%type@';
      $key = strtoupper($key);

      $value = $row['column_type'];
      if (isset($row['character_set_name'])) $value .= ' character set '.$row['character_set_name'];

      $this->replacePairs[$key] = $value;
    }

    $this->io->text(sprintf('Selected %d column types for substitution', sizeof($rows)));
  }
979973
public function getColumns()
    {
        $columns = array();

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

        return $columns;
    }
487116
public function showTables()
	{
		$query = $this->getQuery(true)
			->select('table_name')
			->from('information_schema.tables')
			->where('table_type=' . $this->quote('BASE TABLE'))
			->where('table_schema NOT IN (' . $this->quote('pg_catalog') . ', ' . $this->quote('information_schema') . ' )');

		$this->setQuery($query);

		return $this->loadColumn();
	}
893846
public function all($columns = ['*'])
    {
        if (!empty($this->defaultOrderColumn)) {
            return $this->model->orderBy($this->defaultOrderColumn, $this->defaultOrderDirection)->get($columns);
        }
        return $this->model->get($columns);
    }
192317
private function getColumns()
    {
        $table = $this->table->connect($this->database, Inflector::tabilize($this->tableName));

        return $table->getColumns();
    }
649793
public function fetchColumn()
    {
        $spec = $this->getResult();

        $data = $spec->fetch_row();
        if( is_array($data) ) {
            $data = current($data);
        }

        $this->free();
        return $data;
    }
913330
public function getFields($model)
    {
        //
        $table = $this->getTable($model);

        //
        $sql = "DESC `{$table}`";

        //
        $results = $this->getResults($sql);

        //
        $fields = [];

        //
        foreach ($results as $field) {
            $fields[] = $field['Field'];
        }

        //
        return $fields;
    }
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;
    }
122565
public function getTableColumns(): array
    {
        $columns = [
            'id' => $this->headerText(trans('HCResource::resource_grab_property.id')),'thumbnail_id' => $this->headerText(trans('HCResource::resource_grab_property.thumbnail_id')),'resource_id' => $this->headerText(trans('HCResource::resource_grab_property.resource_id')),'source_id' => $this->headerText(trans('HCResource::resource_grab_property.source_id')),'source_type' => $this->headerText(trans('HCResource::resource_grab_property.source_type')),'x' => $this->headerText(trans('HCResource::resource_grab_property.x')),'y' => $this->headerText(trans('HCResource::resource_grab_property.y')),'zoom' => $this->headerText(trans('HCResource::resource_grab_property.zoom')),
        ];

        return $columns;
    }
890847
protected function _table()
    {
        return $this->_controller()
            ->loadModel(
                null,
                $this->getConfig('modelFactory') ?: $this->_controller()->getModelType()
            );
    }
1152942
protected function columns()
    {
        $this->data    = $this->setData();
        $column_widths = $this->getColumnWidths();
        $output        = [];
        $count         = count(reset($this->data));

        for ($i = 0; $i < $count; $i++) {
            $output[] = $this->getRow($i, $column_widths);
        }

        return $output;
    }
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;
    }
116124
public function getColumns()
    {
        $session = request()->session();
        $key     = $this->key();
        if (!$session->has($key)) {
            return $this->columns;
        }
        $config = $session->get($key);
        foreach ($this->columns as $index => $column) {
            if (!isset($config[$index])) {
                continue;
            }
            $column->visible = $config[$index];
        }

        return $this->columns;
    }
1057993
protected function getTableModel() {
		if ($this->_model === null) {
			$this->_model = $this->createTableModel();
		}
		
		return $this->_model;
	}