You are here

class EntityMetadataArrayObject in Entity API 7

An array object implementation keeping the reference on the given array so changes to the object are reflected in the passed array.

Hierarchy

Expanded class hierarchy of EntityMetadataArrayObject

File

includes/entity.wrapper.inc, line 1245
Provides wrappers allowing easy usage of the entity metadata.

View source
class EntityMetadataArrayObject implements ArrayAccess, Countable, IteratorAggregate {
  protected $data;
  public function __construct(&$array) {
    $this->data =& $array;
  }
  public function &getArray() {
    return $this->data;
  }

  /**
   * Implements the ArrayAccess interface.
   */
  public function offsetGet($delta) {
    return $this->data[$delta];
  }
  public function offsetExists($delta) {
    return array_key_exists($delta, $this->data);
  }
  public function offsetSet($delta, $value) {
    $this->data[$delta] = $value;
  }
  public function offsetUnset($delta) {
    unset($this->data[$delta]);
  }
  public function count() {
    return count($this->data);
  }
  public function getIterator() {
    return new ArrayIterator($this->data);
  }

}

Members