You are here

public function QueryPath::remove in QueryPath 6

Same name and namespace in other branches
  1. 7.3 QueryPath/QueryPath.php \QueryPath::remove()
  2. 7.2 QueryPath/QueryPath.php \QueryPath::remove()

File

QueryPath/QueryPath.php, line 958

Class

QueryPath

Code

public function remove($selector = NULL) {
  if (!empty($selector)) {
    $this
      ->find($selector);
  }
  $found = new SplObjectStorage();
  foreach ($this->matches as $item) {
    $found
      ->attach($item->parentNode
      ->removeChild($item));
  }
  $this
    ->setMatches($found);
  return $this;
}