You are here

protected function QueryPathCssEventHandler::searchForAttr in QueryPath 6

Same name and namespace in other branches
  1. 7.3 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;
}