You are here

public function QueryPathCssEventHandler::attribute in QueryPath 7.3

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

Overrides CssEventHandler::attribute

2 calls to QueryPathCssEventHandler::attribute()
QueryPathCssEventHandler::lang in QueryPath/CssEventHandler.php
QueryPathCssEventHandler::pseudoClass in QueryPath/CssEventHandler.php

File

QueryPath/CssEventHandler.php, line 215

Class

QueryPathCssEventHandler

Code

public function attribute($name, $value = NULL, $operation = CssEventHandler::isExactly) {
  $found = new SplObjectStorage();
  $matches = $this
    ->candidateList();
  foreach ($matches as $item) {
    if ($item
      ->hasAttribute($name)) {
      if (isset($value)) {
        if ($this
          ->attrValMatches($value, $item
          ->getAttribute($name), $operation)) {
          $found
            ->attach($item);
        }
      }
      else {
        $found
          ->attach($item);
      }
    }
  }
  $this->matches = $found;
  $this->findAnyElement = FALSE;
}