You are here

protected function QueryPathCssEventHandler::searchForAttr in QueryPath 7.3

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

File

QueryPath/CssEventHandler.php, line 237

Class

QueryPathCssEventHandler

Code

protected function searchForAttr($name, $value = NULL) {
  $found = new SplObjectStorage();
  $matches = $this
    ->candidateList();
  foreach ($matches as $candidate) {
    if ($candidate
      ->hasAttribute($name)) {
      if (isset($value) && $value == $candidate
        ->getAttribute($name)) {
        $found
          ->attach($candidate);
      }
      else {
        $found
          ->attach($candidate);
      }
    }
  }
  $this->matches = $found;
}