You are here

public function Twig_TemplateTest::getAttribute in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/twig/twig/test/Twig/Tests/TemplateTest.php \Twig_TemplateTest::getAttribute()

Returns the attribute value for a given array/object.

Parameters

mixed $object The object or array from where to get the item:

mixed $item The item to get from the array or object:

array $arguments An array of arguments to pass if the item is an object method:

string $type The type of attribute (@see Twig_Template constants):

bool $isDefinedTest Whether this is only a defined check:

bool $ignoreStrictCheck Whether to ignore the strict attribute check or not:

Return value

mixed The attribute value, or a Boolean when $isDefinedTest is true, or null when the attribute is not set and $ignoreStrictCheck is true

Throws

Twig_Error_Runtime if the attribute does not exist and Twig is running in strict mode and $isDefinedTest is false

Overrides Twig_Template::getAttribute

File

vendor/twig/twig/test/Twig/Tests/TemplateTest.php, line 464

Class

Twig_TemplateTest

Code

public function getAttribute($object, $item, array $arguments = array(), $type = Twig_Template::ANY_CALL, $isDefinedTest = false, $ignoreStrictCheck = false) {
  if ($this->useExtGetAttribute) {
    return twig_template_get_attributes($this, $object, $item, $arguments, $type, $isDefinedTest, $ignoreStrictCheck);
  }
  else {
    return parent::getAttribute($object, $item, $arguments, $type, $isDefinedTest, $ignoreStrictCheck);
  }
}