Current table display fields getter.

@param \Cake\Datasource\RepositoryInterface $table Table instance
@return mixed[]
436537
public static function getListingFields(RepositoryInterface $table): array
    {
        // broadcast event to fetch display fields
        $event = new Event((string)EventName::MODEL_SEARCH_DISPLAY_FIELDS(), null, [
            'table' => $table
        ]);
        EventManager::instance()->dispatch($event);

        $result = (array)$event->result;

        if (empty($result)) {
            $result = static::getDefaultDisplayFields($table);
        }

        $result = array_diff($result, static::getSkippedDisplayFields($table, true));

        // reset numeric indexes
        return array_values($result);
    }
499095
private function getFields($table)
    {
        $fields = $this->entity->getFieldNames();
        if (empty($this->with) && $this->alias === null) {
            return $fields;
        }

        $table = $this->getTableAlias($table);

        $prefixIfMissing = function ($field) use ($table) {
            if (strpos($field, '.') !== false) {
                return $field;
            }

            return $table . '.' . $field;
        };

        return array_map($prefixIfMissing, $fields);
    }
990434
protected function getAdminsRoleEntity(Table $table) : ?EntityInterface
    {
        $result = $table->find()
            ->enableHydration(true)
            ->where(['name' => $this->role])
            ->first();

        Assert::nullOrIsInstanceOf($result, EntityInterface::class);

        return $result;
    }
713000
public function getColumnTypes($table)
    {
        $columns = $this->getSchemaManager()->listTableColumns($table);

        $columnTypes = [];
        foreach ($columns as $column) {
            $columnTypes[$column->getName()] = $column->getType()->getName();
        }

        if (!isset($this->overwrittenColumnTypes[$table])) {
            return $columnTypes;
        }

        return \array_merge($columnTypes, $this->overwrittenColumnTypes[$table]);
    }
1286308
protected function getEnum($table)
	{
		try {
			$result = DB::table('information_schema.columns')
				->where('table_schema', $this->database)
				->where('table_name', $table)
				->where('data_type', 'enum')
				->get(['column_name','column_type']);
			if ($result)
				return $result;
			else
				return [];
		} catch (\Exception $e){
			return [];
		}
	}
80117
public function getColumns($table)
    {
        $query = $this->getUtilityQuery()->showColumns($table);

        $results = $this->query($query, $this->getBinds());
        
        $columns = [];
        foreach ($results as $column) {
            $key = null;
            if ($column['pk'] == 1) {
                $key = 'PRI';
            }
            
            $columns[] = [
                'Field'     => $column['name'],
                'Type'      => $column['type'],
                'Default'   => $column['dflt_value'],
                'Null'      => $column['notnull'] != 1,
                'Key'       => $key
            ];
        }
        
        return $columns;
    }
307837
public function getAliasNames($table) {
    $names = [];
    if (is_array($this->table) && current($this->table) == $table) {
      $names[] = key($this->table);
    }
    foreach ($this->joins->getJoins() as $join) {
      $joinName = $join['name'];
      if (is_array($joinName) && current($joinName) == $table) {
        $names[] = key($joinName);
      }
    }
    return $names;
  }
389622
public function table(Table\Table $table)
    {
        $data = [];
        foreach($table->getRows() as $row) {

            $line = [];
            foreach($table->getColumns() as $name => $column) {
                $line[] = $column->render((array) $row);
            }

            $data[] = $line;
        }

        return $data;
    }
83931
public function getColumns($table)
    {
        //Argument 1 must be a string
        Argument::i()->test(1, 'string');
        
        $query = $this->utility()->showColumns($table);
        $results = $this->query($query, $this->getBinds());
        
        $columns = array();
        foreach ($results as $column) {
            $key = null;
            if ($column['pk'] == 1) {
                $key = 'PRI';
            }
            
            $columns[] = array(
                'Field'     => $column['name'],
                'Type'      => $column['type'],
                'Default'   => $column['dflt_value'],
                'Null'      => $column['notnull'] != 1,
                'Key'       => $key);
        }
        
        return $columns;
    }
1268692
public function getSelectedRows(Request $request, TableInterface $table)
    {
        $identifiers = $request->request->get($table->getSelectionFormKey());
        $entities = $this->loadRowsById($table, $identifiers);

        return $entities;
    }
1097061
public function getTableRelationships($table) {
        $table = $this->connection->getTablePrefix() . Util::camelTo_($table);
        $relationships = array();
        foreach ($this->references as $columnName => $info) {
            if ($info['constraintName'] == 'PRIMARY' || $info['refTable'] != $table)
                    continue;
            $this->setupRelationship($columnName, $info['refColumn'],
                    $info['refTable'], $relationships, false);
        }
        foreach ($this->backReferences as $columnName => $infoArray) {
            foreach ($infoArray as $info) {
                if ($info['refTable'] != $table) continue;
                $this->setupRelationship($columnName, $info['refColumn'],
                        $info['refTable'], $relationships, true);
            }
        }
        return $relationships[$table];
    }
1159569
public function getTableKeys($table)
    {
        $this->connect();

        $keys = array();
        $query = $this->getQuery(true);

        $fieldCasing = $this->getOption(PDO::ATTR_CASE);

        $this->setOption(PDO::ATTR_CASE, PDO::CASE_UPPER);

        $table = strtoupper($table);
        $query->setQuery('pragma table_info( ' . $table . ')');

        // $query->bind(':tableName', $table);

        $this->setQuery($query);
        $rows = $this->loadObjectList();

        foreach ($rows as $column)
        {
            if ($column->PK == 1)
            {
                $keys[$column->NAME] = $column;
            }
        }

        $this->setOption(PDO::ATTR_CASE, $fieldCasing);

        return $keys;
    }
1354307
public function getFields($table,$onlyField=true)
    {
        $this->sql = 'SHOW full columns FROM ' .$this->tablePre. $table;
        $stmt = $this->execute();
        $fields = array();
        $info = $stmt->fetchAll();
        if(!$onlyField) return $info;
        foreach ($info as $value) {
            $fields[] = $value['Field'];
        }
        return $fields;
    }
1080747
private function _getColumns($table)
    {
        if (isset($this->_tables[$table])) {
            return $this->_tables[$table];
        };
        $this->_tables[$table] = false;
        if ($rows = $this->selectArray("PRAGMA table_info({$table})")) {
            $cols = array();
            foreach ($rows as $row) {
                $cols[] = $row['name'];
            };
            if (count($cols) > 0) {
                $this->_tables[$table] = $cols;
            };
        };
        return $this->_tables[$table];
    }
609834
public function getColumns($table)
    {
        $table = str_replace("`", "", $table);

        $columns = Db::fetchAll("SHOW COLUMNS FROM `" . $table . "`");

        $columnNames = array();
        foreach ($columns as $column) {
            $columnNames[] = $column['Field'];
        }

        return $columnNames;
    }
242630
protected function loadColumnListForTable($table)
    {
        if ($this->getDatabaseDriver() === 'sqlite') {
            $statement = "PRAGMA table_info(`{$table}`)";
        } else {
            $statement = "SHOW columns FROM `{$table}`";
        }

        $columnResults = DB::select($statement);
        $columns       = [];

        foreach ($columnResults as $columnObject) {

            $columns[] = array_get(array_values((array) $columnObject), '0');
        }

        return $columns;
    }
1250983
public function getColumns( $table ) {
		$table = $this->safeTable($table);
		$columnsRaw = $this->adapter->get("DESCRIBE $table");
		foreach($columnsRaw as $r) {
			$columns[$r['Field']]=$r['Type'];
		}
		return $columns;
	}