data = new ArrayObject($data); } /** * This is used by SabreAMF when this object is unserialized (from AMF3) * * @param array $data * @return void */ function readExternal($data) { $this->data = new ArrayObject($data); } /** * This is used by SabreAMF when this object is serialized * * @return array */ function writeExternal() { return iterator_to_array($this->data); } /** * implemented from IteratorAggregate * * @return ArrayObject */ function getIterator() { return $this->data; } /** * implemented from ArrayAccess * * @param mixed $offset * @return bool */ function offsetExists($offset) { return isset($this->data[$offset]); } /** * Implemented from ArrayAccess * * @param mixed $offset * @return mixed */ function offsetGet($offset) { return $this->data[$offset]; } /** * Implemented from ArrayAccess * * @param mixed $offset * @param mixed $value * @return void */ function offsetSet($offset,$value) { if (!is_null($offset)) { $this->data[$offset] = $value; } else { $this->data[] = $value; } } /** * Implemented from ArrayAccess * * @param mixed $offset * @return void */ function offsetUnset($offset) { unset($this->data[$offset]); } /** * Implemented from Countable * * @return int */ function count() { return count($this->data); } }