public function SelectQuery::extend

public SelectQuery::extend($extender_name)

Enhance this object by wrapping it in an extender object.

Parameters

$extender_name: The base name of the extending class. The base name will be checked against the current database connection to allow driver-specific subclasses as well, using the same logic as the query objects themselves. For example, PagerDefault_mysql is the MySQL-specific override for PagerDefault.

Return value

QueryExtendableInterface The extender object, which now contains a reference to this object.

Overrides QueryExtendableInterface::extend

File

includes/database/select.inc, line 1139

Class

SelectQuery
Query builder for SELECT statements.

Code

public function extend($extender_name) {
  $override_class = $extender_name . '_' . $this->connection->driver();
  if (class_exists($override_class)) {
    $extender_name = $override_class;
  }
  return new $extender_name($this, $this->connection);
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/includes!database!select.inc/function/SelectQuery::extend/7.x