0 follower

Final Class Yiisoft\Db\Mysql\Column\ColumnDefinitionParser

InheritanceYiisoft\Db\Mysql\Column\ColumnDefinitionParser » Yiisoft\Db\Syntax\ColumnDefinitionParser

Parses column definition string. For example, string(255) or int unsigned.

Psalm Types

Name Value
ExtraInfo array{characterSet?: string, check?: string, collate?: string, comment?: string, defaultValueRaw?: string, extra?: string, notNull?: boolean, unique?: boolean, unsigned?: boolean}

Method Details

Hide inherited methods

extraInfo() protected method

protected array extraInfo ( string $extra )
$extra string

                protected function extraInfo(string $extra): array
{
    $info = parent::extraInfo($extra);
    if (empty($info['extra'])) {
        return $info;
    }
    $extra = $this->parseStringValue($info['extra'], '/\s*\b(?:CHARACTER SET|CHARSET)\s+(\S+)/i', 'characterSet', $info);
    /** @psalm-var ExtraInfo $info */
    if (!empty($extra)) {
        $info['extra'] = $extra;
    } else {
        unset($info['extra']);
    }
    return $info;
}