You are here

public function QueryPathCssEventHandler::elementClass in QueryPath 7.3

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

Overrides CssEventHandler::elementClass

File

QueryPath/CssEventHandler.php, line 200

Class

QueryPathCssEventHandler

Code

public function elementClass($name) {
  $found = new SplObjectStorage();
  $matches = $this
    ->candidateList();
  foreach ($matches as $item) {
    if ($item
      ->hasAttribute('class')) {
      $classes = explode(' ', $item
        ->getAttribute('class'));
      if (in_array($name, $classes)) {
        $found
          ->attach($item);
      }
    }
  }
  $this->matches = $found;
  $this->findAnyElement = FALSE;
}