Interface yii\db\ConstraintFinderInterface
| Implemented by | yii\ |
|---|---|
| Available since version | 2.0.14 |
| Source Code | https://github.com/yiisoft/yii2/blob/master/framework/db/ConstraintFinderInterface.php |
ConstraintFinderInterface defines methods for getting a table constraint information.
Public Methods
| Method | Description | Defined By |
|---|---|---|
| getSchemaChecks() | Returns check constraints for all tables in the database. | yii\ |
| getSchemaDefaultValues() | Returns default value constraints for all tables in the database. | yii\ |
| getSchemaForeignKeys() | Returns foreign keys for all tables in the database. | yii\ |
| getSchemaIndexes() | Returns indexes for all tables in the database. | yii\ |
| getSchemaPrimaryKeys() | Returns primary keys for all tables in the database. | yii\ |
| getSchemaUniques() | Returns unique constraints for all tables in the database. | yii\ |
| getTableChecks() | Obtains the check constraints information for the named table. | yii\ |
| getTableDefaultValues() | Obtains the default value constraints information for the named table. | yii\ |
| getTableForeignKeys() | Obtains the foreign keys information for the named table. | yii\ |
| getTableIndexes() | Obtains the indexes information for the named table. | yii\ |
| getTablePrimaryKey() | Obtains the primary key for the named table. | yii\ |
| getTableUniques() | Obtains the unique constraints information for the named table. | yii\ |
Method Details
Returns check constraints for all tables in the database.
| public abstract \ | ||
| $schema | string |
The schema of the tables. Defaults to empty string, meaning the current or default schema name. |
| $refresh | boolean |
Whether to fetch the latest available table schemas. If this is false, cached data may be returned if available. |
| return | \ |
Check constraints for all tables in the database.
Each array element is an array of yii\ |
|---|---|---|
public function getSchemaChecks($schema = '', $refresh = false);
Returns default value constraints for all tables in the database.
| public abstract yii\ | ||
| $schema | string |
The schema of the tables. Defaults to empty string, meaning the current or default schema name. |
| $refresh | boolean |
Whether to fetch the latest available table schemas. If this is false, cached data may be returned if available. |
| return | yii\ |
Default value constraints for all tables in the database.
Each array element is an array of yii\ |
|---|---|---|
public function getSchemaDefaultValues($schema = '', $refresh = false);
Returns foreign keys for all tables in the database.
| public abstract \ | ||
| $schema | string |
The schema of the tables. Defaults to empty string, meaning the current or default schema name. |
| $refresh | boolean |
Whether to fetch the latest available table schemas. If this is false, cached data may be returned if available. |
| return | \ |
Foreign keys for all tables in the database.
Each array element is an array of yii\ |
|---|---|---|
public function getSchemaForeignKeys($schema = '', $refresh = false);
Returns indexes for all tables in the database.
| public abstract \ | ||
| $schema | string |
The schema of the tables. Defaults to empty string, meaning the current or default schema name. |
| $refresh | boolean |
Whether to fetch the latest available table schemas. If this is false, cached data may be returned if available. |
| return | \ |
Indexes for all tables in the database.
Each array element is an array of yii\ |
|---|---|---|
public function getSchemaIndexes($schema = '', $refresh = false);
Returns primary keys for all tables in the database.
| public abstract yii\ | ||
| $schema | string |
The schema of the tables. Defaults to empty string, meaning the current or default schema name. |
| $refresh | boolean |
Whether to fetch the latest available table schemas. If this is |
| return | yii\ |
Primary keys for all tables in the database.
Each array element is an instance of yii\ |
|---|---|---|
public function getSchemaPrimaryKeys($schema = '', $refresh = false);
Returns unique constraints for all tables in the database.
| public abstract \ | ||
| $schema | string |
The schema of the tables. Defaults to empty string, meaning the current or default schema name. |
| $refresh | boolean |
Whether to fetch the latest available table schemas. If this is false, cached data may be returned if available. |
| return | \ |
Unique constraints for all tables in the database.
Each array element is an array of yii\ |
|---|---|---|
public function getSchemaUniques($schema = '', $refresh = false);
Obtains the check constraints information for the named table.
| public abstract yii\ | ||
| $name | string |
Table name. The table name may contain schema name if any. Do not quote the table name. |
| $refresh | boolean |
Whether to reload the information even if it is found in the cache. |
| return | yii\ |
Table check constraints. |
|---|---|---|
public function getTableChecks($name, $refresh = false);
Obtains the default value constraints information for the named table.
| public abstract yii\ | ||
| $name | string |
Table name. The table name may contain schema name if any. Do not quote the table name. |
| $refresh | boolean |
Whether to reload the information even if it is found in the cache. |
| return | yii\ |
Table default value constraints. |
|---|---|---|
public function getTableDefaultValues($name, $refresh = false);
Obtains the foreign keys information for the named table.
| public abstract yii\ | ||
| $name | string |
Table name. The table name may contain schema name if any. Do not quote the table name. |
| $refresh | boolean |
Whether to reload the information even if it is found in the cache. |
| return | yii\ |
Table foreign keys. |
|---|---|---|
public function getTableForeignKeys($name, $refresh = false);
Obtains the indexes information for the named table.
| public abstract yii\ | ||
| $name | string |
Table name. The table name may contain schema name if any. Do not quote the table name. |
| $refresh | boolean |
Whether to reload the information even if it is found in the cache. |
| return | yii\ |
Table indexes. |
|---|---|---|
public function getTableIndexes($name, $refresh = false);
Obtains the primary key for the named table.
| public abstract yii\ | ||
| $name | string |
Table name. The table name may contain schema name if any. Do not quote the table name. |
| $refresh | boolean |
Whether to reload the information even if it is found in the cache. |
| return | yii\ |
Table primary key, |
|---|---|---|
public function getTablePrimaryKey($name, $refresh = false);
Obtains the unique constraints information for the named table.
| public abstract yii\ | ||
| $name | string |
Table name. The table name may contain schema name if any. Do not quote the table name. |
| $refresh | boolean |
Whether to reload the information even if it is found in the cache. |
| return | yii\ |
Table unique constraints. |
|---|---|---|
public function getTableUniques($name, $refresh = false);
User Contributed Notes
Leave a comment
Join the conversation to share a note.