public function QueryPath::last in QueryPath 6
Same name and namespace in other branches
- 7.3 QueryPath/QueryPath.php \QueryPath::last()
- 7.2 QueryPath/QueryPath.php \QueryPath::last()
File
- QueryPath/
QueryPath.php, line 1712
Class
Code
public function last() {
$found = new SplObjectStorage();
$item = null;
foreach ($this->matches as $m) {
if ($m->nodeType == XML_ELEMENT_NODE) {
$item = $m;
}
}
if ($item) {
$found
->attach($item);
}
$this
->setMatches($found);
$this->matches = $found;
return $this;
}