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 {@see ColumnInterface} for a database column type and initialize column information.
Public Methods
| Method | Description | Defined By |
|---|---|---|
| fromDbType() | Creates an instance of {@see ColumnInterface} for a database column type and initializes column information. | Yiisoft\Db\Schema\Column\ColumnFactoryInterface |
| fromDefinition() | Creates an instance of {@see ColumnInterface} for a database column definition and initializes column information. | Yiisoft\Db\Schema\Column\ColumnFactoryInterface |
| fromPseudoType() | Creates an instance of {@see ColumnInterface} for a pseudo-type and initializes column information. | Yiisoft\Db\Schema\Column\ColumnFactoryInterface |
| fromType() | Creates an instance of {@see ColumnInterface} for an abstract database type and initializes column information. | Yiisoft\Db\Schema\Column\ColumnFactoryInterface |
Method Details
Creates an instance of {@see ColumnInterface} for a database column type and initializes column information.
| public abstract Yiisoft\Db\Schema\Column\ColumnInterface fromDbType ( string $dbType, array $info = [] ) | ||
| $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 {@see ColumnInterface} for a database column definition and initializes column information.
The definition string can contain a native database column type or {@see \Yiisoft\Db\Constant\ColumnType abstract} type or {@see \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 Yiisoft\Db\Schema\Column\ColumnInterface fromDefinition ( string $definition, array $info = [] ) | ||
| $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 {@see ColumnInterface} for a pseudo-type and initializes column information.
| public abstract Yiisoft\Db\Schema\Column\ColumnInterface fromPseudoType ( string $pseudoType, array $info = [] ) | ||
| $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 {@see ColumnInterface} for an abstract database type and initializes column information.
| public abstract Yiisoft\Db\Schema\Column\ColumnInterface fromType ( string $type, array $info = [] ) | ||
| $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.