summaryrefslogtreecommitdiff
path: root/includes/database
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2010-05-11 11:01:36 +0000
committerDries Buytaert <dries@buytaert.net>2010-05-11 11:01:36 +0000
commitfe04e7d35f72214f08446b12a22e09af0076cc2a (patch)
treeafffb812843c8d4b5b0109e3db1c198843a8fa9d /includes/database
parenta4954415212b9c4a74db46bf6f55df5f0f3077c2 (diff)
downloadbrdo-fe04e7d35f72214f08446b12a22e09af0076cc2a.tar.gz
brdo-fe04e7d35f72214f08446b12a22e09af0076cc2a.tar.bz2
- Patch #793604 by matt2000, chx: DBTNG JOINs are close to useless.
Diffstat (limited to 'includes/database')
-rw-r--r--includes/database/select.inc24
1 files changed, 19 insertions, 5 deletions
diff --git a/includes/database/select.inc b/includes/database/select.inc
index 3e7d27762..ddb78c69d 100644
--- a/includes/database/select.inc
+++ b/includes/database/select.inc
@@ -232,7 +232,9 @@ interface SelectQueryInterface extends QueryConditionInterface, QueryAlterableIn
* this clause should use a named placeholder and the value or values to
* insert should be passed in the 4th parameter. For the first table joined
* on a query, this value is ignored as the first table is taken as the base
- * table.
+ * table. The token %alias can be used in this string to be replaced with
+ * the actual alias. This is useful when $alias is modified by the database
+ * system, for example, when joining the same table more than once.
* @param $arguments
* An array of arguments to replace into the $condition of this join.
* @return
@@ -253,7 +255,9 @@ interface SelectQueryInterface extends QueryConditionInterface, QueryAlterableIn
* this clause should use a named placeholder and the value or values to
* insert should be passed in the 4th parameter. For the first table joined
* on a query, this value is ignored as the first table is taken as the base
- * table.
+ * table. The token %alias can be used in this string to be replaced with
+ * the actual alias. This is useful when $alias is modified by the database
+ * system, for example, when joining the same table more than once.
* @param $arguments
* An array of arguments to replace into the $condition of this join.
* @return
@@ -274,7 +278,9 @@ interface SelectQueryInterface extends QueryConditionInterface, QueryAlterableIn
* this clause should use a named placeholder and the value or values to
* insert should be passed in the 4th parameter. For the first table joined
* on a query, this value is ignored as the first table is taken as the base
- * table.
+ * table. The token %alias can be used in this string to be replaced with
+ * the actual alias. This is useful when $alias is modified by the database
+ * system, for example, when joining the same table more than once.
* @param $arguments
* An array of arguments to replace into the $condition of this join.
* @return
@@ -295,7 +301,9 @@ interface SelectQueryInterface extends QueryConditionInterface, QueryAlterableIn
* this clause should use a named placeholder and the value or values to
* insert should be passed in the 4th parameter. For the first table joined
* on a query, this value is ignored as the first table is taken as the base
- * table.
+ * table. The token %alias can be used in this string to be replaced with
+ * the actual alias. This is useful when $alias is modified by the database
+ * system, for example, when joining the same table more than once.
* @param $arguments
* An array of arguments to replace into the $condition of this join.
* @return
@@ -324,7 +332,9 @@ interface SelectQueryInterface extends QueryConditionInterface, QueryAlterableIn
* this clause should use a named placeholder and the value or values to
* insert should be passed in the 4th parameter. For the first table joined
* on a query, this value is ignored as the first table is taken as the base
- * table.
+ * table. The token %alias can be used in this string to be replaced with
+ * the actual alias. This is useful when $alias is modified by the database
+ * system, for example, when joining the same table more than once.
* @param $arguments
* An array of arguments to replace into the $condition of this join.
* @return
@@ -1210,6 +1220,10 @@ class SelectQuery extends Query implements SelectQueryInterface {
}
$alias = $alias_candidate;
+ if (is_string($condition)) {
+ $condition = str_replace('%alias', $alias, $condition);
+ }
+
$this->tables[$alias] = array(
'join type' => $type,
'table' => $table,