public function QueryPath::detach in QueryPath 6
Same name and namespace in other branches
- 7.3 QueryPath/QueryPath.php \QueryPath::detach()
- 7.2 QueryPath/QueryPath.php \QueryPath::detach()
File
- QueryPath/
QueryPath.php, line 1591
Class
Code
public function detach($selector = NULL) {
if (!empty($selector)) {
$this
->find($selector);
}
$found = new SplObjectStorage();
$this->last = $this->matches;
foreach ($this->matches as $item) {
$found
->attach($item->parentNode
->removeChild($item));
}
$this
->setMatches($found);
return $this;
}