You are here

trait ArrayAccessDefinitionTrait in UI Patterns 8

Class ArrayAccessDefinitionTrait.

@property $definition

@package Drupal\ui_patterns\Definition

Hierarchy

File

src/Definition/ArrayAccessDefinitionTrait.php, line 12

Namespace

Drupal\ui_patterns\Definition
View source
trait ArrayAccessDefinitionTrait {

  /**
   * {@inheritdoc}
   */
  public function offsetExists($offset) {
    return array_key_exists($offset, $this->definition);
  }

  /**
   * {@inheritdoc}
   */
  public function offsetGet($offset) {
    return isset($this->definition[$offset]) ? $this->definition[$offset] : NULL;
  }

  /**
   * {@inheritdoc}
   */
  public function offsetSet($offset, $value) {
    $this->definition[$offset] = $value;
  }

  /**
   * {@inheritdoc}
   */
  public function offsetUnset($offset) {
    unset($this->definition[$offset]);
  }

}

Members