W3cubDocs

/Drupal 8

public function Select::extend

public Select::extend($extender_name)

Enhance this object by wrapping it in an extender object.

Parameters

$extender_name: The fully-qualified name of the extender class, without the leading '\' (for example, Drupal\my_module\myExtenderClass). The extender 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.

Return value

\Drupal\Core\Database\Query\ExtendableInterface The extender object, which now contains a reference to this object.

Overrides ExtendableInterface::extend

File

core/lib/Drupal/Core/Database/Query/Select.php, line 319

Class

Select
Query builder for SELECT statements.

Namespace

Drupal\Core\Database\Query

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/core!lib!Drupal!Core!Database!Query!Select.php/function/Select::extend/8.1.x