You are here

public function QueryPathCssEventHandler::elementID in QueryPath 7.3

Same name and namespace in other branches
  1. 6 QueryPath/CssEventHandler.php \QueryPathCssEventHandler::elementID()
  2. 7.2 QueryPath/CssEventHandler.php \QueryPathCssEventHandler::elementID()

Overrides CssEventHandler::elementID

File

QueryPath/CssEventHandler.php, line 86

Class

QueryPathCssEventHandler

Code

public function elementID($id) {
  $found = new SplObjectStorage();
  $matches = $this
    ->candidateList();
  foreach ($matches as $item) {
    if ($item
      ->hasAttribute('id') && $item
      ->getAttribute('id') === $id) {
      $found
        ->attach($item);
      break;
    }
  }
  $this->matches = $found;
  $this->findAnyElement = FALSE;
}