Final Class Yiisoft\Db\Constraint\Index
| Inheritance | Yiisoft\Db\Constraint\Index |
|---|
Represents an index constraint in a database.
An index constraint is a constraint that enforces uniqueness or non-uniqueness of a column or a set of columns.
It has information about the table and column(s) that the constraint applies to, as well as whether the index is unique.
Public Properties
| Property | Type | Description | Defined By |
|---|---|---|---|
| $columnNames | array | Yiisoft\Db\Constraint\Index | |
| $isPrimaryKey | boolean | Yiisoft\Db\Constraint\Index | |
| $isUnique | boolean | Yiisoft\Db\Constraint\Index | |
| $name | string | Yiisoft\Db\Constraint\Index |
Public Methods
| Method | Description | Defined By |
|---|---|---|
| __construct() | Yiisoft\Db\Constraint\Index |
Property Details
Method Details
| public mixed __construct ( string $name = '', string[] $columnNames = [], boolean $isUnique = false, boolean $isPrimaryKey = false ) | ||
| $name | string |
The constraint name. |
| $columnNames | string[] |
The list of column names the constraint belongs to. |
| $isUnique | boolean |
Whether the index is unique. |
| $isPrimaryKey | boolean |
Whether the index was created for a primary key. |
public function __construct(
public readonly string $name = '',
public readonly array $columnNames = [],
public readonly bool $isUnique = false,
public readonly bool $isPrimaryKey = false,
) {}
Signup or Login in order to comment.