Constraint
Less than 1 minute
Constraint
Methods
listConstraints
Retrieves a list of constraints for a given table or all tables in the schema.
public listConstraints(NULL $table, NULL $type, boolean $invertType, false $): voidParameters
| Parameter | Type | Description |
|---|---|---|
$table | NULL | The name of the table. If null, constraints for all tables in the schema will be retrieved. |
$type | NULL | The type of constraints to retrieve. If null, all types of constraints will be retrieved. |
$invertType | boolean | Whether to invert the constraint type filter. If true, constraints of types other than the specified type will be retrieved. |
$ | false |
addConstraint
Adds a constraint to a table in the database.
public addConstraint(string $constraintName, array $info): boolParameters
| Parameter | Type | Description |
|---|---|---|
$constraintName | string | the name of the constraint to add |
$info | array |
dropConstraint
public dropConstraint(string $constraintName, string $tableName, bool $ifExists, bool $cascade): boolParameters
| Parameter | Type | Description |
|---|---|---|
$constraintName | string | |
$tableName | string | |
$ifExists | bool | |
$cascade | bool |
Generated by Hazaar API Doc Generator on Wed, 07 Jan 2026 11:29:59 +0000