mixed getTriggerDefinition(
string
$trigger)
|
|
Get the structure of a trigger into an array
EXPERIMENTAL
WARNING: this function is experimental and may change the returned value at any time until labelled as non-experimental
Parameters:
array tableInfo(
object|string
$result, [int
$mode = null])
|
|
Returns information about a table or a result set
The format of the resulting array depends on which $mode you select. The sample output below is based on this query:
SELECT tblFoo.fldID, tblFoo.fldPhone, tblBar.fldId
FROM tblFoo
JOIN tblBar ON tblFoo.fldId = tblBar.fldId
- null (default)
[0] => Array (
[table] => tblFoo
[name] => fldId
[type] => int
[len] => 11
[flags] => primary_key not_null
)
[1] => Array (
[table] => tblFoo
[name] => fldPhone
[type] => string
[len] => 20
[flags] =>
)
[2] => Array (
[table] => tblBar
[name] => fldId
[type] => int
[len] => 11
[flags] => primary_key not_null
)
- MDB2_TABLEINFO_ORDER
<p>In addition to the information found in the default output,
a notation of the number of columns is provided by the
num_fields element while the order
element provides an array with the column names as the keys and
their location index number (corresponding to the keys in the
the default output) as the values.</p>
<p>If a result set has identical field names, the last one is
used.</p>
[num_fields] => 3
[order] => Array (
[fldId] => 2
[fldTrans] => 1
)
- MDB2_TABLEINFO_ORDERTABLE
<p>Similar to MDB2_TABLEINFO_ORDER but adds more
dimensions to the array in which the table names are keys and
the field names are sub-keys. This is helpful for queries that
join tables which have identical field names.</p>
[num_fields] => 3
[ordertable] => Array (
[tblFoo] => Array (
[fldId] => 0
[fldPhone] => 1
)
[tblBar] => Array (
[fldId] => 2
)
)
The flags element contains a space separated list of extra information about the field. This data is inconsistent between DBMS's due to the way each DBMS works.
- primary_key
- unique_key
- multiple_key
- not_null
Most DBMS's only provide the
table and
flags elements if
$result is a table name. The following DBMS's provide full information from queries:
If the 'portability' option has
MDB2_PORTABILITY_FIX_CASE turned on, the names of tables and fields will be lower or upper cased.
Parameters: