0 フォロワー

トレイト yii\db\ConstraintFinderTrait

実装者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.13
ソースコード https://github.com/yiisoft/yii2/blob/master/framework/db/ConstraintFinderTrait.php

ConstraintFinderTrait は、テーブルの制約情報を取得するためのメソッドを提供します。

公開プロパティ

継承されたプロパティを隠す

プロパティ 説明 定義元
$schemaChecks \yii\db\CheckConstraint[][] データベース内のすべてのテーブルのチェック制約。 yii\db\ConstraintFinderTrait
$schemaDefaultValues yii\db\DefaultValueConstraint[] データベース内のすべてのテーブルのデフォルト値制約。 yii\db\ConstraintFinderTrait
$schemaForeignKeys \yii\db\ForeignKeyConstraint[][] データベース内のすべてのテーブルの外部キー。 yii\db\ConstraintFinderTrait
$schemaIndexes \yii\db\IndexConstraint[][] データベース内のすべてのテーブルのインデックス。 yii\db\ConstraintFinderTrait
$schemaPrimaryKeys yii\db\Constraint[] データベース内のすべてのテーブルの主キー。 yii\db\ConstraintFinderTrait
$schemaUniques \yii\db\IndexConstraint[][] データベース内のすべてのテーブルの一意性制約。 yii\db\ConstraintFinderTrait

公開メソッド

継承されたメソッドを隠す

メソッド 説明 定義元
getSchemaChecks() データベース内のすべてのテーブルのチェック制約を返します。 yii\db\ConstraintFinderTrait
getSchemaDefaultValues() データベース内のすべてのテーブルのデフォルト値制約を返します。 yii\db\ConstraintFinderTrait
getSchemaForeignKeys() データベース内のすべてのテーブルの外部キーを返します。 yii\db\ConstraintFinderTrait
getSchemaIndexes() データベース内のすべてのテーブルのインデックスを返します。 yii\db\ConstraintFinderTrait
getSchemaPrimaryKeys() データベース内のすべてのテーブルの主キーを返します。 yii\db\ConstraintFinderTrait
getSchemaUniques() データベース内のすべてのテーブルの一意性制約を返します。 yii\db\ConstraintFinderTrait
getTableChecks() 指定されたテーブルのチェック制約情報を取得します。 yii\db\ConstraintFinderTrait
getTableDefaultValues() 指定されたテーブルのデフォルト値制約情報を取得します。 yii\db\ConstraintFinderTrait
getTableForeignKeys() 指定されたテーブルの外部キー情報を取得します。 yii\db\ConstraintFinderTrait
getTableIndexes() 指定されたテーブルのインデックス情報を取得します。 yii\db\ConstraintFinderTrait
getTablePrimaryKey() 指定されたテーブルの主キーを取得します。 yii\db\ConstraintFinderTrait
getTableUniques() 指定されたテーブルの一意性制約情報を取得します。 yii\db\ConstraintFinderTrait

保護されたメソッド

継承されたメソッドを隠す

メソッド 説明 定義元
getSchemaMetadata() 指定されたスキーマ内のすべてのテーブルについて、指定されたタイプのメタデータを返します。 yii\db\ConstraintFinderTrait
getTableMetadata() 指定されたテーブルの、指定されたタイプのメタデータを返します。 yii\db\ConstraintFinderTrait
loadTableChecks() 指定されたテーブルのすべてのチェック制約をロードします。 yii\db\ConstraintFinderTrait
loadTableDefaultValues() 指定されたテーブルのすべてのデフォルト値制約をロードします。 yii\db\ConstraintFinderTrait
loadTableForeignKeys() 指定されたテーブルのすべての外部キーをロードします。 yii\db\ConstraintFinderTrait
loadTableIndexes() 指定されたテーブルのすべてのインデックスをロードします。 yii\db\ConstraintFinderTrait
loadTablePrimaryKey() 指定されたテーブルの主キーをロードします。 yii\db\ConstraintFinderTrait
loadTableUniques() 指定されたテーブルのすべての一意性制約をロードします。 yii\db\ConstraintFinderTrait

プロパティの詳細

継承されたプロパティを隠す

$schemaChecks public プロパティ

データベース内のすべてのテーブルのチェック制約。各配列要素は、yii\db\CheckConstraint またはその子クラスの配列です。このプロパティは読み取り専用です。

public \yii\db\CheckConstraint[][] $schemaChecks null
$schemaDefaultValues public プロパティ

データベース内のすべてのテーブルのデフォルト値制約。各配列要素は、yii\db\DefaultValueConstraint またはその子クラスの配列です。このプロパティは読み取り専用です。

$schemaForeignKeys public プロパティ

データベース内のすべてのテーブルの外部キー。各配列要素は、yii\db\ForeignKeyConstraint またはその子クラスの配列です。このプロパティは読み取り専用です。

public \yii\db\ForeignKeyConstraint[][] $schemaForeignKeys null
$schemaIndexes public プロパティ

データベース内のすべてのテーブルのインデックス。各配列要素は、yii\db\IndexConstraint またはその子クラスの配列です。このプロパティは読み取り専用です。

public \yii\db\IndexConstraint[][] $schemaIndexes null
$schemaPrimaryKeys public プロパティ

データベース内のすべてのテーブルのプライマリキー。各配列要素は、yii\db\Constraintまたはその子クラスのインスタンスです。このプロパティは読み取り専用です。

$schemaUniques public プロパティ

データベース内のすべてのテーブルの一意制約。各配列要素は、yii\db\IndexConstraintまたはその子クラスの配列です。このプロパティは読み取り専用です。

public \yii\db\IndexConstraint[][] $schemaUniques null

メソッド詳細

継承されたメソッドを隠す

getSchemaChecks() public メソッド

データベース内のすべてのテーブルのチェック制約を返します。

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

テーブルのスキーマ。デフォルトは空の文字列で、現在のスキーマ名またはデフォルトのスキーマ名を意味します。

$refresh boolean

利用可能な最新のテーブルスキーマを取得するかどうか。falseの場合、キャッシュされたデータが利用可能な場合は返される可能性があります。

return \yii\db\CheckConstraint[][]

データベース内のすべてのテーブルのチェック制約。各配列要素は、yii\db\CheckConstraintまたはその子クラスの配列です。

                public function getSchemaChecks($schema = '', $refresh = false)
{
    return $this->getSchemaMetadata($schema, 'checks', $refresh);
}

            
getSchemaDefaultValues() public メソッド

データベース内のすべてのテーブルのデフォルト値制約を返します。

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

テーブルのスキーマ。デフォルトは空の文字列で、現在のスキーマ名またはデフォルトのスキーマ名を意味します。

$refresh boolean

利用可能な最新のテーブルスキーマを取得するかどうか。falseの場合、キャッシュされたデータが利用可能な場合は返される可能性があります。

return yii\db\DefaultValueConstraint[]

データベース内のすべてのテーブルのデフォルト値制約。各配列要素は、yii\db\DefaultValueConstraintまたはその子クラスの配列です。

                public function getSchemaDefaultValues($schema = '', $refresh = false)
{
    return $this->getSchemaMetadata($schema, 'defaultValues', $refresh);
}

            
getSchemaForeignKeys() public メソッド

データベース内のすべてのテーブルの外部キーを返します。

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

テーブルのスキーマ。デフォルトは空の文字列で、現在のスキーマ名またはデフォルトのスキーマ名を意味します。

$refresh boolean

利用可能な最新のテーブルスキーマを取得するかどうか。falseの場合、キャッシュされたデータが利用可能な場合は返される可能性があります。

return \yii\db\ForeignKeyConstraint[][]

データベース内のすべてのテーブルの外部キー。各配列要素は、yii\db\ForeignKeyConstraintまたはその子クラスの配列です。

                public function getSchemaForeignKeys($schema = '', $refresh = false)
{
    return $this->getSchemaMetadata($schema, 'foreignKeys', $refresh);
}

            
getSchemaIndexes() public メソッド

データベース内のすべてのテーブルのインデックスを返します。

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

テーブルのスキーマ。デフォルトは空の文字列で、現在のスキーマ名またはデフォルトのスキーマ名を意味します。

$refresh boolean

利用可能な最新のテーブルスキーマを取得するかどうか。falseの場合、キャッシュされたデータが利用可能な場合は返される可能性があります。

return \yii\db\IndexConstraint[][]

データベース内のすべてのテーブルのインデックス。各配列要素は、yii\db\IndexConstraintまたはその子クラスの配列です。

                public function getSchemaIndexes($schema = '', $refresh = false)
{
    return $this->getSchemaMetadata($schema, 'indexes', $refresh);
}

            
getSchemaMetadata() protected abstract メソッド

指定されたスキーマ内のすべてのテーブルについて、指定されたタイプのメタデータを返します。

protected abstract array getSchemaMetadata ( $schema, $type, $refresh )
$schema string

メタデータのスキーマ。デフォルトは空の文字列で、現在のスキーマ名またはデフォルトのスキーマ名を意味します。

$type string

メタデータのタイプ。

$refresh boolean

利用可能な最新のテーブルメタデータを取得するかどうか。これがfalseの場合、キャッシュされたデータが利用可能な場合は返される可能性があります。

return array

メタデータの配列。

                abstract protected function getSchemaMetadata($schema, $type, $refresh);

            
getSchemaPrimaryKeys() public メソッド

データベース内のすべてのテーブルの主キーを返します。

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

テーブルのスキーマ。デフォルトは空の文字列で、現在のスキーマ名またはデフォルトのスキーマ名を意味します。

$refresh boolean

利用可能な最新のテーブルスキーマを取得するかどうか。これがfalseの場合、キャッシュされたデータが利用可能な場合は返される可能性があります。

return yii\db\Constraint[]

データベース内のすべてのテーブルのプライマリキー。各配列要素は、yii\db\Constraintまたはその子クラスのインスタンスです。

                public function getSchemaPrimaryKeys($schema = '', $refresh = false)
{
    return $this->getSchemaMetadata($schema, 'primaryKey', $refresh);
}

            
getSchemaUniques() public メソッド

データベース内のすべてのテーブルの一意性制約を返します。

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

テーブルのスキーマ。デフォルトは空の文字列で、現在のスキーマ名またはデフォルトのスキーマ名を意味します。

$refresh boolean

利用可能な最新のテーブルスキーマを取得するかどうか。falseの場合、キャッシュされたデータが利用可能な場合は返される可能性があります。

return \yii\db\Constraint[][]

データベース内のすべてのテーブルの一意制約。各配列要素は、yii\db\Constraintまたはその子クラスの配列です。

                public function getSchemaUniques($schema = '', $refresh = false)
{
    return $this->getSchemaMetadata($schema, 'uniques', $refresh);
}

            
getTableChecks() public メソッド

指定されたテーブルのチェック制約情報を取得します。

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

テーブル名。テーブル名には、スキーマ名が含まれる場合があります。テーブル名を引用符で囲まないでください。

$refresh boolean

キャッシュで見つかった場合でも、情報をリロードするかどうか。

return yii\db\CheckConstraint[]

テーブルのチェック制約。

                public function getTableChecks($name, $refresh = false)
{
    return $this->getTableMetadata($name, 'checks', $refresh);
}

            
getTableDefaultValues() public メソッド

指定されたテーブルのデフォルト値制約情報を取得します。

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

テーブル名。テーブル名には、スキーマ名が含まれる場合があります。テーブル名を引用符で囲まないでください。

$refresh boolean

キャッシュで見つかった場合でも、情報をリロードするかどうか。

return yii\db\DefaultValueConstraint[]

テーブルのデフォルト値制約。

                public function getTableDefaultValues($name, $refresh = false)
{
    return $this->getTableMetadata($name, 'defaultValues', $refresh);
}

            
getTableForeignKeys() public メソッド

指定されたテーブルの外部キー情報を取得します。

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

テーブル名。テーブル名には、スキーマ名が含まれる場合があります。テーブル名を引用符で囲まないでください。

$refresh boolean

キャッシュで見つかった場合でも、情報をリロードするかどうか。

return yii\db\ForeignKeyConstraint[]

テーブルの外部キー。

                public function getTableForeignKeys($name, $refresh = false)
{
    return $this->getTableMetadata($name, 'foreignKeys', $refresh);
}

            
getTableIndexes() public メソッド

指定されたテーブルのインデックス情報を取得します。

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

テーブル名。テーブル名には、スキーマ名が含まれる場合があります。テーブル名を引用符で囲まないでください。

$refresh boolean

キャッシュで見つかった場合でも、情報をリロードするかどうか。

return yii\db\IndexConstraint[]

テーブルのインデックス。

                public function getTableIndexes($name, $refresh = false)
{
    return $this->getTableMetadata($name, 'indexes', $refresh);
}

            
getTableMetadata() protected abstract メソッド

指定されたテーブルの、指定されたタイプのメタデータを返します。

protected abstract mixed getTableMetadata ( $name, $type, $refresh )
$name string

テーブル名。テーブル名には、スキーマ名が含まれる場合があります。テーブル名を引用符で囲まないでください。

$type string

メタデータのタイプ。

$refresh boolean

キャッシュに見つかった場合でも、テーブルのメタデータをリロードするかどうか。

return mixed

メタデータ。

                abstract protected function getTableMetadata($name, $type, $refresh);

            
getTablePrimaryKey() public メソッド

指定されたテーブルの主キーを取得します。

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

テーブル名。テーブル名には、スキーマ名が含まれる場合があります。テーブル名を引用符で囲まないでください。

$refresh boolean

キャッシュで見つかった場合でも、情報をリロードするかどうか。

return yii\db\Constraint|null

テーブルの主キー。テーブルに主キーがない場合は null

                public function getTablePrimaryKey($name, $refresh = false)
{
    return $this->getTableMetadata($name, 'primaryKey', $refresh);
}

            
getTableUniques() public メソッド

指定されたテーブルの一意性制約情報を取得します。

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

テーブル名。テーブル名には、スキーマ名が含まれる場合があります。テーブル名を引用符で囲まないでください。

$refresh boolean

キャッシュで見つかった場合でも、情報をリロードするかどうか。

return yii\db\Constraint[]

テーブルの一意制約。

                public function getTableUniques($name, $refresh = false)
{
    return $this->getTableMetadata($name, 'uniques', $refresh);
}

            
loadTableChecks() protected abstract メソッド

指定されたテーブルのすべてのチェック制約をロードします。

protected abstract yii\db\CheckConstraint[] loadTableChecks ( $tableName )
$tableName string

テーブル名。

return yii\db\CheckConstraint[]

指定されたテーブルのチェック制約。

                abstract protected function loadTableChecks($tableName);

            
loadTableDefaultValues() protected abstract メソッド

指定されたテーブルのすべてのデフォルト値制約をロードします。

protected abstract yii\db\DefaultValueConstraint[] loadTableDefaultValues ( $tableName )
$tableName string

テーブル名。

return yii\db\DefaultValueConstraint[]

指定されたテーブルのデフォルト値制約。

                abstract protected function loadTableDefaultValues($tableName);

            
loadTableForeignKeys() protected abstract メソッド

指定されたテーブルのすべての外部キーをロードします。

protected abstract yii\db\ForeignKeyConstraint[] loadTableForeignKeys ( $tableName )
$tableName string

テーブル名。

return yii\db\ForeignKeyConstraint[]

指定されたテーブルの外部キー。

                abstract protected function loadTableForeignKeys($tableName);

            
loadTableIndexes() protected abstract メソッド

指定されたテーブルのすべてのインデックスをロードします。

protected abstract yii\db\IndexConstraint[] loadTableIndexes ( $tableName )
$tableName string

テーブル名。

return yii\db\IndexConstraint[]

指定されたテーブルのインデックス。

                abstract protected function loadTableIndexes($tableName);

            
loadTablePrimaryKey() protected abstract メソッド

指定されたテーブルの主キーをロードします。

protected abstract yii\db\Constraint|null loadTablePrimaryKey ( $tableName )
$tableName string

テーブル名。

return yii\db\Constraint|null

指定されたテーブルの主キー。テーブルに主キーがない場合は null

                abstract protected function loadTablePrimaryKey($tableName);

            
loadTableUniques() protected abstract メソッド

指定されたテーブルのすべての一意性制約をロードします。

protected abstract yii\db\Constraint[] loadTableUniques ( $tableName )
$tableName string

テーブル名。

return yii\db\Constraint[]

指定されたテーブルの一意制約。

                abstract protected function loadTableUniques($tableName);