Skip to content

Commit e169d60

Browse files
authored
Merge pull request #2199 from MGatner/getForeignKeyData
Add getForeignKeyData to User Guide
2 parents 3768431 + ba6218d commit e169d60

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

user_guide_src/source/database/metadata.rst

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,3 +150,19 @@ Usage example::
150150
The key types may be unique to the database you are using.
151151
For instance, MySQL will return one of primary, fulltext, spatial, index or unique
152152
for each key associated with a table.
153+
154+
**$db->getForeignKeyData()**
155+
156+
Returns an array of objects containing foreign key information.
157+
158+
Usage example::
159+
160+
$keys = $db->getForeignKeyData('table_name');
161+
162+
foreach ($keys as $key)
163+
{
164+
echo $key->constraint_name;
165+
echo $key->table_name;
166+
echo $key->foreign_table_name;
167+
}
168+

0 commit comments

Comments
 (0)