You are here

public function Translator::addAttributeMatching in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/css-selector/XPath/Translator.php \Symfony\Component\CssSelector\XPath\Translator::addAttributeMatching()

Parameters

XPathExpr $xpath:

string $operator:

string $attribute:

string $value:

Return value

XPathExpr

Throws

ExpressionErrorException

File

vendor/symfony/css-selector/XPath/Translator.php, line 273

Class

Translator
XPath expression translator interface.

Namespace

Symfony\Component\CssSelector\XPath

Code

public function addAttributeMatching(XPathExpr $xpath, $operator, $attribute, $value) {
  if (!isset($this->attributeMatchingTranslators[$operator])) {
    throw new ExpressionErrorException(sprintf('Attribute matcher operator "%s" not supported.', $operator));
  }
  return call_user_func($this->attributeMatchingTranslators[$operator], $xpath, $attribute, $value);
}