Interface Yiisoft\Db\Schema\Column\ColumnFactoryInterface
| Implemented by | Yiisoft\Db\Schema\Column\AbstractColumnFactory |
|---|
The interface must be implemented by a column factory class. It should create an instance of Yiisoft\Db\Schema\Column\ColumnInterface for a database column type and initialize column information.
Psalm Types
| Name | Value |
|---|---|
| ColumnInfo | array{autoIncrement?: boolean, check?: string|null, collation?: string|null, column?: Yiisoft\Db\Schema\Column\ColumnInterface|null, columns?: array<string, Yiisoft\Db\Schema\Column\ColumnInterface>, comment?: string|null, computed?: boolean, dbTimezone?: string, dbType?: string|null, defaultValue?: mixed, defaultValueRaw?: string|null, dimension?: positive-int, extra?: string|null, primaryKey?: boolean, name?: string|null, notNull?: boolean, reference?: Yiisoft\Db\Constraint\ForeignKey|null, scale?: integer|null, schema?: string|null, size?: integer|null, source?: \Yiisoft\Db\Constant\ColumnInfoSource::*, table?: string|null, type?: \Yiisoft\Db\Constant\ColumnType::*, unique?: boolean, unsigned?: boolean, values?: array|null} |
Public Methods
| Method | Description | Defined By |
|---|---|---|
| fromDbType() | Creates an instance of Yiisoft\Db\Schema\Column\ColumnInterface for a database column type and initializes column information. | Yiisoft\Db\Schema\Column\ColumnFactoryInterface |
| fromDefinition() | Creates an instance of Yiisoft\Db\Schema\Column\ColumnInterface for a database column definition and initializes column information. | Yiisoft\Db\Schema\Column\ColumnFactoryInterface |
| fromPseudoType() | Creates an instance of Yiisoft\Db\Schema\Column\ColumnInterface for a pseudo-type and initializes column information. | Yiisoft\Db\Schema\Column\ColumnFactoryInterface |
| fromType() | Creates an instance of Yiisoft\Db\Schema\Column\ColumnInterface for an abstract database type and initializes column information. | Yiisoft\Db\Schema\Column\ColumnFactoryInterface |
Method Details
Creates an instance of Yiisoft\Db\Schema\Column\ColumnInterface for a database column type and initializes column information.
| public abstract fromDbType( string $dbType, array $info = [] ): Yiisoft\Db\Schema\Column\ColumnInterface | ||
| $dbType | string |
The database column type. |
| $info | array |
The column information. The set of parameters may be different for a specific DBMS. |
public function fromDbType(string $dbType, array $info = []): ColumnInterface;
Creates an instance of Yiisoft\Db\Schema\Column\ColumnInterface for a database column definition and initializes column information.
The definition string can contain a native database column type or \Yiisoft\Db\Constant\ColumnType abstract type or \Yiisoft\Db\Constant\PseudoType pseudo type, its size, default value, etc.
For example, varchar(255) NOT NULL is varchar database type with 255 size and a NOT NULL constraint.
| public abstract fromDefinition( string $definition, array $info = [] ): Yiisoft\Db\Schema\Column\ColumnInterface | ||
| $definition | string |
The database column definition. |
| $info | array |
The column information. The set of parameters may be different for a specific DBMS. |
public function fromDefinition(string $definition, array $info = []): ColumnInterface;
Creates an instance of Yiisoft\Db\Schema\Column\ColumnInterface for a pseudo-type and initializes column information.
| public abstract fromPseudoType( string $pseudoType, array $info = [] ): Yiisoft\Db\Schema\Column\ColumnInterface | ||
| $pseudoType | string |
The pseudo-type. |
| $info | array |
The column information. The set of parameters may be different for a specific DBMS. |
public function fromPseudoType(string $pseudoType, array $info = []): ColumnInterface;
Creates an instance of Yiisoft\Db\Schema\Column\ColumnInterface for an abstract database type and initializes column information.
| public abstract fromType( string $type, array $info = [] ): Yiisoft\Db\Schema\Column\ColumnInterface | ||
| $type | string |
The abstract database type. |
| $info | array |
The column information. The set of parameters may be different for a specific DBMS. |
public function fromType(string $type, array $info = []): ColumnInterface;
Signup or Login in order to comment.