ConstraintFinderInterface
in
ConstraintFinderInterface defines methods for getting a table constraint information.
Tags
Table of Contents
Methods
- getSchemaChecks() : array<string|int, array<string|int, CheckConstraint>>
- Returns check constraints for all tables in the database.
- getSchemaDefaultValues() : array<string|int, DefaultValueConstraint>
- Returns default value constraints for all tables in the database.
- getSchemaForeignKeys() : array<string|int, array<string|int, ForeignKeyConstraint>>
- Returns foreign keys for all tables in the database.
- getSchemaIndexes() : array<string|int, array<string|int, IndexConstraint>>
- Returns indexes for all tables in the database.
- getSchemaPrimaryKeys() : array<string|int, Constraint>
- Returns primary keys for all tables in the database.
- getSchemaUniques() : array<string|int, array<string|int, Constraint>>
- Returns unique constraints for all tables in the database.
- getTableChecks() : array<string|int, CheckConstraint>
- Obtains the check constraints information for the named table.
- getTableDefaultValues() : array<string|int, DefaultValueConstraint>
- Obtains the default value constraints information for the named table.
- getTableForeignKeys() : array<string|int, ForeignKeyConstraint>
- Obtains the foreign keys information for the named table.
- getTableIndexes() : array<string|int, IndexConstraint>
- Obtains the indexes information for the named table.
- getTablePrimaryKey() : Constraint|null
- Obtains the primary key for the named table.
- getTableUniques() : array<string|int, Constraint>
- Obtains the unique constraints information for the named table.
Methods
getSchemaChecks()
Returns check constraints for all tables in the database.
public
getSchemaChecks([string $schema = '' ][, bool $refresh = false ]) : array<string|int, array<string|int, CheckConstraint>>
Parameters
- $schema : string = ''
-
the schema of the tables. Defaults to empty string, meaning the current or default schema name.
- $refresh : bool = false
-
whether to fetch the latest available table schemas. If this is false, cached data may be returned if available.
Return values
array<string|int, array<string|int, CheckConstraint>> —check constraints for all tables in the database. Each array element is an array of [[CheckConstraint]] or its child classes.
getSchemaDefaultValues()
Returns default value constraints for all tables in the database.
public
getSchemaDefaultValues([string $schema = '' ][, bool $refresh = false ]) : array<string|int, DefaultValueConstraint>
Parameters
- $schema : string = ''
-
the schema of the tables. Defaults to empty string, meaning the current or default schema name.
- $refresh : bool = false
-
whether to fetch the latest available table schemas. If this is false, cached data may be returned if available.
Return values
array<string|int, DefaultValueConstraint> —default value constraints for all tables in the database. Each array element is an array of [[DefaultValueConstraint]] or its child classes.
getSchemaForeignKeys()
Returns foreign keys for all tables in the database.
public
getSchemaForeignKeys([string $schema = '' ][, bool $refresh = false ]) : array<string|int, array<string|int, ForeignKeyConstraint>>
Parameters
- $schema : string = ''
-
the schema of the tables. Defaults to empty string, meaning the current or default schema name.
- $refresh : bool = false
-
whether to fetch the latest available table schemas. If this is false, cached data may be returned if available.
Return values
array<string|int, array<string|int, ForeignKeyConstraint>> —foreign keys for all tables in the database. Each array element is an array of [[ForeignKeyConstraint]] or its child classes.
getSchemaIndexes()
Returns indexes for all tables in the database.
public
getSchemaIndexes([string $schema = '' ][, bool $refresh = false ]) : array<string|int, array<string|int, IndexConstraint>>
Parameters
- $schema : string = ''
-
the schema of the tables. Defaults to empty string, meaning the current or default schema name.
- $refresh : bool = false
-
whether to fetch the latest available table schemas. If this is false, cached data may be returned if available.
Return values
array<string|int, array<string|int, IndexConstraint>> —indexes for all tables in the database. Each array element is an array of [[IndexConstraint]] or its child classes.
getSchemaPrimaryKeys()
Returns primary keys for all tables in the database.
public
getSchemaPrimaryKeys([string $schema = '' ][, bool $refresh = false ]) : array<string|int, Constraint>
Parameters
- $schema : string = ''
-
the schema of the tables. Defaults to empty string, meaning the current or default schema name.
- $refresh : bool = false
-
whether to fetch the latest available table schemas. If this is
false
, cached data may be returned if available.
Return values
array<string|int, Constraint> —primary keys for all tables in the database. Each array element is an instance of [[Constraint]] or its child class.
getSchemaUniques()
Returns unique constraints for all tables in the database.
public
getSchemaUniques([string $schema = '' ][, bool $refresh = false ]) : array<string|int, array<string|int, Constraint>>
Parameters
- $schema : string = ''
-
the schema of the tables. Defaults to empty string, meaning the current or default schema name.
- $refresh : bool = false
-
whether to fetch the latest available table schemas. If this is false, cached data may be returned if available.
Return values
array<string|int, array<string|int, Constraint>> —unique constraints for all tables in the database. Each array element is an array of [[Constraint]] or its child classes.
getTableChecks()
Obtains the check constraints information for the named table.
public
getTableChecks(string $name[, bool $refresh = false ]) : array<string|int, CheckConstraint>
Parameters
- $name : string
-
table name. The table name may contain schema name if any. Do not quote the table name.
- $refresh : bool = false
-
whether to reload the information even if it is found in the cache.
Return values
array<string|int, CheckConstraint> —table check constraints.
getTableDefaultValues()
Obtains the default value constraints information for the named table.
public
getTableDefaultValues(string $name[, bool $refresh = false ]) : array<string|int, DefaultValueConstraint>
Parameters
- $name : string
-
table name. The table name may contain schema name if any. Do not quote the table name.
- $refresh : bool = false
-
whether to reload the information even if it is found in the cache.
Return values
array<string|int, DefaultValueConstraint> —table default value constraints.
getTableForeignKeys()
Obtains the foreign keys information for the named table.
public
getTableForeignKeys(string $name[, bool $refresh = false ]) : array<string|int, ForeignKeyConstraint>
Parameters
- $name : string
-
table name. The table name may contain schema name if any. Do not quote the table name.
- $refresh : bool = false
-
whether to reload the information even if it is found in the cache.
Return values
array<string|int, ForeignKeyConstraint> —table foreign keys.
getTableIndexes()
Obtains the indexes information for the named table.
public
getTableIndexes(string $name[, bool $refresh = false ]) : array<string|int, IndexConstraint>
Parameters
- $name : string
-
table name. The table name may contain schema name if any. Do not quote the table name.
- $refresh : bool = false
-
whether to reload the information even if it is found in the cache.
Return values
array<string|int, IndexConstraint> —table indexes.
getTablePrimaryKey()
Obtains the primary key for the named table.
public
getTablePrimaryKey(string $name[, bool $refresh = false ]) : Constraint|null
Parameters
- $name : string
-
table name. The table name may contain schema name if any. Do not quote the table name.
- $refresh : bool = false
-
whether to reload the information even if it is found in the cache.
Return values
Constraint|null —table primary key, null
if the table has no primary key.
getTableUniques()
Obtains the unique constraints information for the named table.
public
getTableUniques(string $name[, bool $refresh = false ]) : array<string|int, Constraint>
Parameters
- $name : string
-
table name. The table name may contain schema name if any. Do not quote the table name.
- $refresh : bool = false
-
whether to reload the information even if it is found in the cache.
Return values
array<string|int, Constraint> —table unique constraints.