# Interface yii\db\ConstraintFinderInterface

Implemented by | yii\db\cubrid\Schema, yii\db\mssql\Schema, yii\db\mysql\Schema, yii\db\oci\Schema, yii\db\pgsql\Schema, yii\db\sqlite\Schema
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

Hide inherited methods

Method | Description | Defined By
--- | --- | ---
getSchemaChecks() | Returns check constraints for all tables in the database. | yii\db\ConstraintFinderInterface
getSchemaDefaultValues() | Returns default value constraints for all tables in the database. | yii\db\ConstraintFinderInterface
getSchemaForeignKeys() | Returns foreign keys for all tables in the database. | yii\db\ConstraintFinderInterface
getSchemaIndexes() | Returns indexes for all tables in the database. | yii\db\ConstraintFinderInterface
getSchemaPrimaryKeys() | Returns primary keys for all tables in the database. | yii\db\ConstraintFinderInterface
getSchemaUniques() | Returns unique constraints for all tables in the database. | yii\db\ConstraintFinderInterface
getTableChecks() | Obtains the check constraints information for the named table. | yii\db\ConstraintFinderInterface
getTableDefaultValues() | Obtains the default value constraints information for the named table. | yii\db\ConstraintFinderInterface
getTableForeignKeys() | Obtains the foreign keys information for the named table. | yii\db\ConstraintFinderInterface
getTableIndexes() | Obtains the indexes information for the named table. | yii\db\ConstraintFinderInterface
getTablePrimaryKey() | Obtains the primary key for the named table. | yii\db\ConstraintFinderInterface
getTableUniques() | Obtains the unique constraints information for the named table. | yii\db\ConstraintFinderInterface

## Method Details

getSchemaChecks() public abstract method

Returns check constraints for all tables in the database.

public abstract \yii\db\CheckConstraint[][] getSchemaChecks ( $schema = '', $refresh = false )
$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\db\CheckConstraint[][] | Check constraints for all tables in the database. Each array element is an array of yii\db\CheckConstraint or its child classes.

getSchemaDefaultValues() public abstract method

Returns default value constraints for all tables in the database.

public abstract yii\db\DefaultValueConstraint[] getSchemaDefaultValues ( $schema = '', $refresh = false )
$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\db\DefaultValueConstraint[] | Default value constraints for all tables in the database. Each array element is an array of yii\db\DefaultValueConstraint or its child classes.

getSchemaForeignKeys() public abstract method

Returns foreign keys for all tables in the database.

public abstract \yii\db\ForeignKeyConstraint[][] getSchemaForeignKeys ( $schema = '', $refresh = false )
$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\db\ForeignKeyConstraint[][] | Foreign keys for all tables in the database. Each array element is an array of yii\db\ForeignKeyConstraint or its child classes.

getSchemaIndexes() public abstract method

Returns indexes for all tables in the database.

public abstract \yii\db\IndexConstraint[][] getSchemaIndexes ( $schema = '', $refresh = false )
$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\db\IndexConstraint[][] | Indexes for all tables in the database. Each array element is an array of yii\db\IndexConstraint or its child classes.

getSchemaPrimaryKeys() public abstract method

Returns primary keys for all tables in the database.

public abstract yii\db\Constraint[] getSchemaPrimaryKeys ( $schema = '', $refresh = false )
$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\db\Constraint[] | Primary keys for all tables in the database. Each array element is an instance of yii\db\Constraint or its child class.

getSchemaUniques() public abstract method

Returns unique constraints for all tables in the database.

public abstract \yii\db\Constraint[][] getSchemaUniques ( $schema = '', $refresh = false )
$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\db\Constraint[][] | Unique constraints for all tables in the database. Each array element is an array of yii\db\Constraint or its child classes.

getTableChecks() public abstract method

Obtains the check constraints information for the named table.

public abstract yii\db\CheckConstraint[] getTableChecks ( $name, $refresh = false )
$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\db\CheckConstraint[] | Table check constraints.

getTableDefaultValues() public abstract method

Obtains the default value constraints information for the named table.

public abstract yii\db\DefaultValueConstraint[] getTableDefaultValues ( $name, $refresh = false )
$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\db\DefaultValueConstraint[] | Table default value constraints.

getTableForeignKeys() public abstract method

Obtains the foreign keys information for the named table.

public abstract yii\db\ForeignKeyConstraint[] getTableForeignKeys ( $name, $refresh = false )
$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\db\ForeignKeyConstraint[] | Table foreign keys.

getTableIndexes() public abstract method

Obtains the indexes information for the named table.

public abstract yii\db\IndexConstraint[] getTableIndexes ( $name, $refresh = false )
$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\db\IndexConstraint[] | Table indexes.

getTablePrimaryKey() public abstract method

Obtains the primary key for the named table.

public abstract yii\db\Constraint|null getTablePrimaryKey ( $name, $refresh = false )
$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\db\Constraint|null | Table primary key, `null` if the table has no primary key.

getTableUniques() public abstract method

Obtains the unique constraints information for the named table.

public abstract yii\db\Constraint[] getTableUniques ( $name, $refresh = false )
$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\db\Constraint[] | Table unique constraints.