summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--adodb.inc.php16
-rw-r--r--drivers/adodb-db2.inc.php15
-rw-r--r--drivers/adodb-informix72.inc.php2
-rw-r--r--drivers/adodb-mssql.inc.php2
-rw-r--r--drivers/adodb-mssqlnative.inc.php2
-rw-r--r--drivers/adodb-mysql.inc.php3
-rw-r--r--drivers/adodb-mysqli.inc.php2
-rw-r--r--drivers/adodb-oci8.inc.php15
-rw-r--r--drivers/adodb-odbc_mssql.inc.php3
-rw-r--r--drivers/adodb-odbtp.inc.php2
-rw-r--r--drivers/adodb-pdo.inc.php11
-rw-r--r--drivers/adodb-postgres7.inc.php5
-rw-r--r--drivers/adodb-sqlite3.inc.php2
13 files changed, 45 insertions, 35 deletions
diff --git a/adodb.inc.php b/adodb.inc.php
index 0c32f1a4..1c8089a6 100644
--- a/adodb.inc.php
+++ b/adodb.inc.php
@@ -1776,9 +1776,21 @@ if (!defined('_ADODB_LAYER')) {
}
/**
- * @returns assoc array where keys are tables, and values are foreign keys
+ * Returns a list of Foreign Keys associated with a specific table.
+ *
+ * If there are no foreign keys then the function returns false.
+ *
+ * @param string $table The name of the table to get the foreign keys for.
+ * @param string $owner Table owner/schema.
+ * @param bool $upper If true, only matches the table with the uppercase name.
+ * @param bool $associative Returns the result in associative mode;
+ * if ADODB_FETCH_MODE is already associative, then
+ * this parameter is discarded.
+ *
+ * @return string[]|false An array where keys are tables, and values are foreign keys;
+ * false if no foreign keys could be found.
*/
- function MetaForeignKeys($table, $owner=false, $upper=false) {
+ function metaForeignKeys($table, $owner = '', $upper = false, $associative = false) {
return false;
}
diff --git a/drivers/adodb-db2.inc.php b/drivers/adodb-db2.inc.php
index 8f616fa6..1ed2541b 100644
--- a/drivers/adodb-db2.inc.php
+++ b/drivers/adodb-db2.inc.php
@@ -684,16 +684,17 @@ class ADODB_db2 extends ADOConnection {
}
/**
- * returns assoc array where keys are tables, and values are foreign keys
+ * Returns a list of Foreign Keys associated with a specific table.
*
- * @param string $table
- * @param string $owner [optional][discarded]
- * @param bool $upper [optional][discarded]
- * @param bool $associative[optional][discarded]
+ * @param string $table
+ * @param string $owner discarded
+ * @param bool $upper discarded
+ * @param bool $associative discarded
*
- * @return mixed[] Array of foreign key information
+ * @return string[]|false An array where keys are tables, and values are foreign keys;
+ * false if no foreign keys could be found.
*/
- public function metaForeignKeys($table, $owner = FALSE, $upper = FALSE, $asociative = FALSE )
+ public function metaForeignKeys($table, $owner = '', $upper = false, $associative = false)
{
global $ADODB_FETCH_MODE;
diff --git a/drivers/adodb-informix72.inc.php b/drivers/adodb-informix72.inc.php
index 41494236..79e5138a 100644
--- a/drivers/adodb-informix72.inc.php
+++ b/drivers/adodb-informix72.inc.php
@@ -258,7 +258,7 @@ class ADODB_informix72 extends ADOConnection {
return ADOConnection::MetaColumns($table,false);
}
- function MetaForeignKeys($table, $owner=false, $upper=false) //!Eos
+ public function metaForeignKeys($table, $owner = '', $upper = false, $associative = false)
{
$sql = "
select tr.tabname,updrule,delrule,
diff --git a/drivers/adodb-mssql.inc.php b/drivers/adodb-mssql.inc.php
index 3de3f8d3..8fb92249 100644
--- a/drivers/adodb-mssql.inc.php
+++ b/drivers/adodb-mssql.inc.php
@@ -429,7 +429,7 @@ class ADODB_mssql extends ADOConnection {
return $indexes;
}
- function MetaForeignKeys($table, $owner=false, $upper=false)
+ public function metaForeignKeys($table, $owner = '', $upper = false, $associative = false)
{
global $ADODB_FETCH_MODE;
diff --git a/drivers/adodb-mssqlnative.inc.php b/drivers/adodb-mssqlnative.inc.php
index 27564a6d..dba647cb 100644
--- a/drivers/adodb-mssqlnative.inc.php
+++ b/drivers/adodb-mssqlnative.inc.php
@@ -719,7 +719,7 @@ class ADODB_mssqlnative extends ADOConnection {
return $indexes;
}
- function MetaForeignKeys($table, $owner=false, $upper=false)
+ public function metaForeignKeys($table, $owner = '', $upper = false, $associative = false)
{
global $ADODB_FETCH_MODE;
diff --git a/drivers/adodb-mysql.inc.php b/drivers/adodb-mysql.inc.php
index 9bd54c22..13122ada 100644
--- a/drivers/adodb-mysql.inc.php
+++ b/drivers/adodb-mysql.inc.php
@@ -698,8 +698,7 @@ class ADODB_mysql extends ADOConnection {
return 4294967295;
}
- // "Innox - Juan Carlos Gonzalez" <jgonzalez#innox.com.mx>
- function metaForeignKeys( $table, $owner = FALSE, $upper = FALSE, $associative = FALSE )
+ public function metaForeignKeys($table, $owner = '', $upper = false, $associativee = false)
{
global $ADODB_FETCH_MODE;
if ($ADODB_FETCH_MODE == ADODB_FETCH_ASSOC || $this->fetchMode == ADODB_FETCH_ASSOC) $associative = true;
diff --git a/drivers/adodb-mysqli.inc.php b/drivers/adodb-mysqli.inc.php
index fa9fdc03..8b33cd88 100644
--- a/drivers/adodb-mysqli.inc.php
+++ b/drivers/adodb-mysqli.inc.php
@@ -844,7 +844,7 @@ class ADODB_mysqli extends ADOConnection {
*
* @return array|bool An array of foreign keys, or false no foreign keys could be found.
*/
- function MetaForeignKeys($table, $owner = false, $upper = false, $associative = false)
+ public function metaForeignKeys($table, $owner = '', $upper = false, $associative = false)
{
global $ADODB_FETCH_MODE;
diff --git a/drivers/adodb-oci8.inc.php b/drivers/adodb-oci8.inc.php
index e660d467..97c97390 100644
--- a/drivers/adodb-oci8.inc.php
+++ b/drivers/adodb-oci8.inc.php
@@ -1484,16 +1484,17 @@ SELECT /*+ RULE */ distinct b.column_name
}
/**
- * returns assoc array where keys are tables, and values are foreign keys
+ * Returns a list of Foreign Keys associated with a specific table.
*
- * @param str $table
- * @param str $owner [optional][default=NULL]
- * @param bool $upper [optional][discarded]
- * @return mixed[] Array of foreign key information
+ * @param string $table
+ * @param string $owner
+ * @param bool $upper discarded
+ * @param bool $associative discarded
*
- * @link http://gis.mit.edu/classes/11.521/sqlnotes/referential_integrity.html
+ * @return string[]|false An array where keys are tables, and values are foreign keys;
+ * false if no foreign keys could be found.
*/
- function MetaForeignKeys($table, $owner=false, $upper=false)
+ public function metaForeignKeys($table, $owner = '', $upper = false, $associative = false)
{
global $ADODB_FETCH_MODE;
diff --git a/drivers/adodb-odbc_mssql.inc.php b/drivers/adodb-odbc_mssql.inc.php
index 37185aac..9f53d3d7 100644
--- a/drivers/adodb-odbc_mssql.inc.php
+++ b/drivers/adodb-odbc_mssql.inc.php
@@ -81,8 +81,7 @@ class ADODB_odbc_mssql extends ADODB_odbc {
return $this->GetOne($this->identitySQL);
}
-
- function MetaForeignKeys($table, $owner=false, $upper=false)
+ public function metaForeignKeys($table, $owner = '', $upper = false, $associative = false)
{
global $ADODB_FETCH_MODE;
diff --git a/drivers/adodb-odbtp.inc.php b/drivers/adodb-odbtp.inc.php
index bd167a1c..41bd0873 100644
--- a/drivers/adodb-odbtp.inc.php
+++ b/drivers/adodb-odbtp.inc.php
@@ -393,7 +393,7 @@ class ADODB_odbtp extends ADOConnection{
return $arr2;
}
- function MetaForeignKeys($table, $owner='', $upper=false)
+ public function metaForeignKeys($table, $owner = '', $upper = false, $associative = false)
{
global $ADODB_FETCH_MODE;
diff --git a/drivers/adodb-pdo.inc.php b/drivers/adodb-pdo.inc.php
index 7b676d3b..3b4d1f54 100644
--- a/drivers/adodb-pdo.inc.php
+++ b/drivers/adodb-pdo.inc.php
@@ -314,18 +314,19 @@ class ADODB_pdo extends ADOConnection {
}
/**
- * Returns a list of Foreign Keys for a specified table.
+ * Returns a list of Foreign Keys associated with a specific table.
*
* @param string $table
- * @param bool $owner (optional) not used in this driver
+ * @param string $owner (optional) not used in this driver
* @param bool $upper
* @param bool $associative
*
- * @return string[] where keys are tables, and values are foreign keys
+ * @return string[]|false An array where keys are tables, and values are foreign keys;
+ * false if no foreign keys could be found.
*/
- public function metaForeignKeys($table, $owner=false, $upper=false,$associative=false) {
+ public function metaForeignKeys($table, $owner = '', $upper = false, $associative = false) {
if (method_exists($this->_driver,'metaForeignKeys'))
- return $this->_driver->metaForeignKeys($table,$owner,$upper,$associative);
+ return $this->_driver->metaForeignKeys($table, $owner, $upper, $associative);
}
/**
diff --git a/drivers/adodb-postgres7.inc.php b/drivers/adodb-postgres7.inc.php
index e408f208..b4730a9d 100644
--- a/drivers/adodb-postgres7.inc.php
+++ b/drivers/adodb-postgres7.inc.php
@@ -154,10 +154,7 @@ class ADODB_postgres7 extends ADODB_postgres64 {
}
}
- /**
- * @returns array where keys are tables, and values are foreign keys
- */
- function MetaForeignKeys($table, $owner=false, $upper=false)
+ public function metaForeignKeys($table, $owner = '', $upper = false, $associative = false)
{
# Regex isolates the 2 terms between parenthesis using subexpressions
$regex = '^.*\((.*)\).*\((.*)\).*$';
diff --git a/drivers/adodb-sqlite3.inc.php b/drivers/adodb-sqlite3.inc.php
index 901f6468..318171a8 100644
--- a/drivers/adodb-sqlite3.inc.php
+++ b/drivers/adodb-sqlite3.inc.php
@@ -206,7 +206,7 @@ class ADODB_sqlite3 extends ADOConnection {
return $arr;
}
- function metaForeignKeys( $table, $owner = FALSE, $upper = FALSE, $associative = FALSE )
+ public function metaForeignKeys($table, $owner = '', $upper = false, $associative = false)
{
global $ADODB_FETCH_MODE;
if ($ADODB_FETCH_MODE == ADODB_FETCH_ASSOC