Gets a table column.

@param string $name The table column name.

@throws \Fridge\DBAL\Exception\SchemaException If the column does not exist.

@return \Fridge\DBAL\Schema\Column The table column.
544022
public function getColumn($name)
    {
        if (!$this->hasColumn($name)) {
            throw SchemaException::tableColumnDoesNotExist($this->getName(), $name);
        }

        return $this->columns[$name];
    }
164718
public function getColumn(string $name): AbstractColumn
    {
        if (!$this->schema->hasColumn($name)) {
            throw new DefinitionException("Undefined column {$name} in {$this->schema->getName()}");
        }

        return clone $this->schema->column($name);
    }
107034
public function field($name)
    {
        return $this->fields()->first(function (Field $field) use ($name) {
            return $field->column() == $name;
        });
    }
1091337
public function getColumn($name)
    {
        return isset($this->columns[$name]) ? $this->columns[$name] : false;
    }
1270659
public function dropColumn($name)
    {
        if (!$this->hasColumn($name)) {
            return $this;
        }

        $builder = $this->db->getQuery(true)->getGrammar();

        $query = $builder::dropColumn($this->getName(), $name);

        $this->db->setQuery($query)->execute();

        return $this->reset();
    }
563965
public function getColumn($name, $alias = '')
    {
        $column = new DerivedColumn($name, $alias);

        return $column->setTable($this);
    }
201341
public function find(string $name): Column
    {
        if (! \array_key_exists($name, $this->keyMap)) {
            throw new InvalidArgumentException("Name [{$name}] is not available.");
        }

        return $this->columns[$this->keyMap[$name]];
    }
526047
final public function findIndexColumnByName(string $name): ? IndexColumn
    {
        /** @var IndexColumn $indexColumn */
        foreach ($this->columns as $indexColumn) {
            $column = $indexColumn->getColumn();
            if ($column::getName() === $name) {
                return $indexColumn;
            }
        }

        return null;
    }
361765
public function getColumn(string $name)
    {
        if (!isset($this->fields[$name])) {
            Throw new ColumnException(sprintf('A field named "%s" does not exist in this table', $name));
        }

        return $this->fields[$name];
    }
1127230
public function getRecord($name = null)
    {
        $recordName = $name ?: $this->record;

        if ($recordName === false) {
            return new NullRecord();
        }

        $recordName = $recordName ?: $this->getName();

        $mapper = $this->getDataMapper($name);

        if ($mapper instanceof AbstractDatabaseMapperProxy) {
            $mapper = $mapper::getInstance();
        }

        // (1) If name is class, just new it.
        if (class_exists($recordName)) {
            return new $recordName($this->table, $this->keys, $mapper);
        }

        // (2): Find object from registered namespaces
        if ($record = RecordResolver::create($recordName, $this->table, $this->keys, $mapper)) {
            return $record;
        }

        $errors[] = sprintf(
            'Record: "%s" not found from namespaces: (%s)',
            $recordName,
            implode(" |\n ", RecordResolver::dumpNamespaces())
        );

        // (3): Find from package directory.
        $class = sprintf(
            '%s\Record\%sRecord',
            MvcHelper::getPackageNamespace(static::class, 2),
            ucfirst($recordName)
        );

        if (class_exists($class)) {
            return new $class($this->table, $this->keys, $mapper);
        }

        $errors[] = sprintf('Class: %s not exists.', $class);

        // If name is NULL and this model prepared a default record name.
        // We must throw exception to tell developers record not found.
        if (!$name && $this->record) {
            throw new \LogicException(implode("\n- ", $errors));
        }

        // If name not NULL, set it as table name, otherwise use pre-set table property.
        $table = $name ?: $this->table;

        if (!$table) {
            throw new \LogicException(
                'Please add table property to ' . get_called_class() . " to support Record object. \n" .
                implode("\n- ", $errors)
            );
        }

        // (4): If name is null, we get default object with table name provided.
        return new Record($table, $this->keys, $mapper);
    }
290683
public function column($name)
    {
        $column = new ColumnSchema($this, $name);
        $this->columns[$name] = $column;
        return $column;
    }
795264
public function getColumnInstance($name)
    {
        if (
            isset($this->metadata[Metadata::FIELD_INSTANCES][$name])
            && $this->metadata[Metadata::FIELD_INSTANCES][$name] instanceof Field
        ) {
            return $this->metadata[Metadata::FIELD_INSTANCES][$name];
        }
        
        throw new NotFoundException('Cannot found column definition for ":name"', ['name' => $name]);
    }
1151084
public function getColumn($name)
    {
        foreach ($this->getColumns() as $column) {
            if ($column->getName() === $name) {
                return $column;
            }
        }

    }
313089
public function withName(string $name) : Table
    {
        if ($this->name === $name) {
            return $this;
        }

        return new self($name, $this->columns, $this->indexes, $this->foreignKeys);
    }
1319326
public function get(string $name) : Type
    {
        if (! isset($this->instances[$name])) {
            throw DBALException::unknownColumnType($name);
        }

        return $this->instances[$name];
    }
5886
protected function findTableFromName($name)
    {
        foreach ($this->tables as $table) {
            if ($table->getName() === $name) {
                return $table;
            }
        }

        return null;
    }
856493
public static function get_schema($name = 'default')
    {
        $connection = self::get_conn($name);
        if ($connection) {
            return $connection->getSchemaManager();
        }
        return null;
    }