ForeignKeyConstraint
API reference › yii › db › ForeignKeyConstraint
ForeignKeyConstraint represents the metadata of a table FOREIGN KEY constraint.
Properties
Section titled “Properties”| Property | Type | Description | Defined by |
|---|---|---|---|
$columnNames | string[]| | List of column names the constraint belongs to. Default: null. | Constraint |
$foreignColumnNames | string[] | List of referenced table column names. Default: null. | ForeignKeyConstraint |
$foreignSchemaName | string| | Referenced table schema name. Default: null. | ForeignKeyConstraint |
$foreignTableName | string | Referenced table name. Default: null. | ForeignKeyConstraint |
$name | string| | The constraint name. Default: null. | Constraint |
$onDelete | string| | Referential action if rows in a referenced table are to be deleted. Default: null. | ForeignKeyConstraint |
$onUpdate | string| | Referential action if rows in a referenced table are to be updated. Default: null. | ForeignKeyConstraint |
Methods
Section titled “Methods”| Method | Description | Defined by |
|---|---|---|
__construct() | Constructor. | yii\ |
__call() | Calls the named method which is not a class method. | yii\ |
__get() | Returns the value of an object property. | yii\ |
__isset() | Checks if a property is set, i.e. defined and not null. | yii\ |
__set() | Sets value of an object property. | yii\ |
__unset() | Sets an object property to null. | yii\ |
canGetProperty() | Returns a value indicating whether a property can be read. | yii\ |
canSetProperty() | Returns a value indicating whether a property can be set. | yii\ |
className() static | Returns the fully qualified name of this class. | yii\ |
hasMethod() | Returns a value indicating whether a method is defined. | yii\ |
hasProperty() | Returns a value indicating whether a property is defined. | yii\ |
init() | Initializes the object. | yii\ |