W3cubDocs

/Drupal 8

public function Select::__clone

public Select::__clone()

Implements the magic __clone function.

Overrides Query::__clone

File

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

Class

Select
Query builder for SELECT statements.

Namespace

Drupal\Core\Database\Query

Code

public function __clone() {
  // On cloning, also clone the dependent objects. However, we do not
  // want to clone the database connection object as that would duplicate the
  // connection itself.

  $this->condition = clone($this->condition);
  $this->having = clone($this->having);
  foreach ($this->union as $key => $aggregate) {
    $this->union[$key]['query'] = clone($aggregate['query']);
  }
}

© 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::__clone/8.1.x