Db::getForeignKeys
Usage
array Db::getForeignKeys(string $table_name)Description
Get all foreign key constraints of a database table.Parameters
Parameter | Required | Type | Description |
---|---|---|---|
$table_name | Yes | string | The table name to get foreign key constraints of. |
Return Value
Returns an array the keys being the column name with a foreign key constraint, and the value being an associative array of constraint details.Examples
Get Foreign Keys
$keys = $this->db->getForeignKeys('user_profiles');
// Display keys
print_r($keys);
// The above will output:
Array
(
[uuid] => Array
(
[table] => armor_users
[column] => uuid
[type] => one_to_one
)
)