public function SelectQuery::__clone

public SelectQuery::__clone()

Implements the magic __clone function.

Overrides Query::__clone

File

includes/database/select.inc, line 1601

Class

SelectQuery
Query builder for SELECT statements.

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->where = clone($this->where);
  $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/includes!database!select.inc/function/SelectQuery::__clone/7.x