0 關注者

介面 yii\db\ConstraintFinderInterface

實作於yii\db\cubrid\Schema, yii\db\mssql\Schema, yii\db\mysql\Schema, yii\db\oci\Schema, yii\db\pgsql\Schema, yii\db\sqlite\Schema
自版本起可用2.0.14
原始碼 https://github.com/yiisoft/yii2/blob/master/framework/db/ConstraintFinderInterface.php

ConstraintFinderInterface 定義了用於獲取表格約束資訊的方法。

公共方法

隱藏繼承的方法

方法 描述 定義於
getSchemaChecks() 傳回資料庫中所有表格的檢查約束。 yii\db\ConstraintFinderInterface
getSchemaDefaultValues() 傳回資料庫中所有表格的預設值約束。 yii\db\ConstraintFinderInterface
getSchemaForeignKeys() 傳回資料庫中所有表格的外鍵。 yii\db\ConstraintFinderInterface
getSchemaIndexes() 傳回資料庫中所有表格的索引。 yii\db\ConstraintFinderInterface
getSchemaPrimaryKeys() 傳回資料庫中所有表格的主鍵。 yii\db\ConstraintFinderInterface
getSchemaUniques() 傳回資料庫中所有表格的唯一約束。 yii\db\ConstraintFinderInterface
getTableChecks() 獲取指定表格的檢查約束資訊。 yii\db\ConstraintFinderInterface
getTableDefaultValues() 獲取指定表格的預設值約束資訊。 yii\db\ConstraintFinderInterface
getTableForeignKeys() 獲取指定表格的外鍵資訊。 yii\db\ConstraintFinderInterface
getTableIndexes() 獲取指定表格的索引資訊。 yii\db\ConstraintFinderInterface
getTablePrimaryKey() 獲取指定表格的主鍵。 yii\db\ConstraintFinderInterface
getTableUniques() 獲取指定表格的唯一約束資訊。 yii\db\ConstraintFinderInterface

方法詳情

隱藏繼承的方法

getSchemaChecks() public abstract method

傳回資料庫中所有表格的檢查約束。

public abstract \yii\db\CheckConstraint[][] getSchemaChecks ( $schema '', $refresh false )
$schema string

表格的綱要 (schema)。預設為空字串,表示目前的或預設的綱要名稱。

$refresh boolean

是否獲取最新的可用表格綱要。如果此值為 false,則在可用的情況下可能會傳回快取資料。

return \yii\db\CheckConstraint[][]

資料庫中所有表格的 Check 约束。每個陣列元素都是 yii\db\CheckConstraint 或其子類別的陣列。

                public function getSchemaChecks($schema = '', $refresh = false);

            
getSchemaDefaultValues() public abstract method

傳回資料庫中所有表格的預設值約束。

public abstract yii\db\DefaultValueConstraint[] getSchemaDefaultValues ( $schema '', $refresh false )
$schema string

表格的綱要 (schema)。預設為空字串,表示目前的或預設的綱要名稱。

$refresh boolean

是否獲取最新的可用表格綱要。如果此值為 false,則在可用的情況下可能會傳回快取資料。

return yii\db\DefaultValueConstraint[]

資料庫中所有表格的預設值約束。每個陣列元素都是 yii\db\DefaultValueConstraint 或其子類別的陣列。

                public function getSchemaDefaultValues($schema = '', $refresh = false);

            
getSchemaForeignKeys() public abstract method

傳回資料庫中所有表格的外鍵。

public abstract \yii\db\ForeignKeyConstraint[][] getSchemaForeignKeys ( $schema '', $refresh false )
$schema string

表格的綱要 (schema)。預設為空字串,表示目前的或預設的綱要名稱。

$refresh boolean

是否獲取最新的可用表格綱要。如果此值為 false,則在可用的情況下可能會傳回快取資料。

return \yii\db\ForeignKeyConstraint[][]

資料庫中所有表格的外鍵。每個陣列元素都是 yii\db\ForeignKeyConstraint 或其子類別的陣列。

                public function getSchemaForeignKeys($schema = '', $refresh = false);

            
getSchemaIndexes() public abstract method

傳回資料庫中所有表格的索引。

public abstract \yii\db\IndexConstraint[][] getSchemaIndexes ( $schema '', $refresh false )
$schema string

表格的綱要 (schema)。預設為空字串,表示目前的或預設的綱要名稱。

$refresh boolean

是否獲取最新的可用表格綱要。如果此值為 false,則在可用的情況下可能會傳回快取資料。

return \yii\db\IndexConstraint[][]

資料庫中所有表格的索引。每個陣列元素都是 yii\db\IndexConstraint 或其子類別的陣列。

                public function getSchemaIndexes($schema = '', $refresh = false);

            
getSchemaPrimaryKeys() public abstract method

傳回資料庫中所有表格的主鍵。

public abstract yii\db\Constraint[] getSchemaPrimaryKeys ( $schema '', $refresh false )
$schema string

表格的綱要 (schema)。預設為空字串,表示目前的或預設的綱要名稱。

$refresh boolean

是否獲取最新的可用表格綱要。如果此值為 false,則在可用的情況下可能會傳回快取資料。

return yii\db\Constraint[]

資料庫中所有表格的主鍵。每個陣列元素都是 yii\db\Constraint 或其子類別的實例。

                public function getSchemaPrimaryKeys($schema = '', $refresh = false);

            
getSchemaUniques() public abstract method

傳回資料庫中所有表格的唯一約束。

public abstract \yii\db\Constraint[][] getSchemaUniques ( $schema '', $refresh false )
$schema string

表格的綱要 (schema)。預設為空字串,表示目前的或預設的綱要名稱。

$refresh boolean

是否獲取最新的可用表格綱要。如果此值為 false,則在可用的情況下可能會傳回快取資料。

return \yii\db\Constraint[][]

資料庫中所有表格的 Unique 约束。每個陣列元素都是 yii\db\Constraint 或其子類別的陣列。

                public function getSchemaUniques($schema = '', $refresh = false);

            
getTableChecks() public abstract method

獲取指定表格的檢查約束資訊。

public abstract yii\db\CheckConstraint[] getTableChecks ( $name, $refresh false )
$name string

表格名稱。表格名稱可以包含綱要名稱 (schema name)(如果有的話)。請勿引用表格名稱。

$refresh boolean

即使在快取中找到資訊,是否重新載入資訊。

return yii\db\CheckConstraint[]

表格 Check 约束。

                public function getTableChecks($name, $refresh = false);

            
getTableDefaultValues() public abstract method

獲取指定表格的預設值約束資訊。

public abstract yii\db\DefaultValueConstraint[] getTableDefaultValues ( $name, $refresh false )
$name string

表格名稱。表格名稱可以包含綱要名稱 (schema name)(如果有的話)。請勿引用表格名稱。

$refresh boolean

即使在快取中找到資訊,是否重新載入資訊。

return yii\db\DefaultValueConstraint[]

表格預設值約束。

                public function getTableDefaultValues($name, $refresh = false);

            
getTableForeignKeys() public abstract method

獲取指定表格的外鍵資訊。

public abstract yii\db\ForeignKeyConstraint[] getTableForeignKeys ( $name, $refresh false )
$name string

表格名稱。表格名稱可以包含綱要名稱 (schema name)(如果有的話)。請勿引用表格名稱。

$refresh boolean

即使在快取中找到資訊,是否重新載入資訊。

return yii\db\ForeignKeyConstraint[]

表格外鍵。

                public function getTableForeignKeys($name, $refresh = false);

            
getTableIndexes() public abstract method

獲取指定表格的索引資訊。

public abstract yii\db\IndexConstraint[] getTableIndexes ( $name, $refresh false )
$name string

表格名稱。表格名稱可以包含綱要名稱 (schema name)(如果有的話)。請勿引用表格名稱。

$refresh boolean

即使在快取中找到資訊,是否重新載入資訊。

return yii\db\IndexConstraint[]

表格索引。

                public function getTableIndexes($name, $refresh = false);

            
getTablePrimaryKey() public abstract method

獲取指定表格的主鍵。

public abstract yii\db\Constraint|null getTablePrimaryKey ( $name, $refresh false )
$name string

表格名稱。表格名稱可以包含綱要名稱 (schema name)(如果有的話)。請勿引用表格名稱。

$refresh boolean

即使在快取中找到資訊,是否重新載入資訊。

return yii\db\Constraint|null

表格主鍵,如果表格沒有主鍵,則為 null

                public function getTablePrimaryKey($name, $refresh = false);

            
getTableUniques() public abstract method

獲取指定表格的唯一約束資訊。

public abstract yii\db\Constraint[] getTableUniques ( $name, $refresh false )
$name string

表格名稱。表格名稱可以包含綱要名稱 (schema name)(如果有的話)。請勿引用表格名稱。

$refresh boolean

即使在快取中找到資訊,是否重新載入資訊。

return yii\db\Constraint[]

表格 Unique 约束。

                public function getTableUniques($name, $refresh = false);