function DataDefinition::offsetExists

Same name in other branches
  1. 9 core/lib/Drupal/Core/TypedData/DataDefinition.php \Drupal\Core\TypedData\DataDefinition::offsetExists()
  2. 10 core/lib/Drupal/Core/TypedData/DataDefinition.php \Drupal\Core\TypedData\DataDefinition::offsetExists()
  3. 11.x core/lib/Drupal/Core/TypedData/DataDefinition.php \Drupal\Core\TypedData\DataDefinition::offsetExists()

This is for BC support only. @todo: Remove in https://www.drupal.org/node/1928868.

File

core/lib/Drupal/Core/TypedData/DataDefinition.php, line 304

Class

DataDefinition
A typed data definition class for defining data based on defined data types.

Namespace

Drupal\Core\TypedData

Code

public function offsetExists($offset) {
    // PHP's array access does not work correctly with isset(), so we have to
    // bake isset() in here. See https://bugs.php.net/bug.php?id=41727.
    return array_key_exists($offset, $this->definition) && isset($this->definition[$offset]);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.