1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216 |
- <?php
- abstract class EntityMetadataWrapper {
- protected $type;
- protected $data;
- protected $info;
- protected $cache = array();
-
- public function __construct($type, $data = NULL, $info = array()) {
- $this->type = $type;
- $this->info = $info + array(
- 'langcode' => NULL,
- );
- $this->info['type'] = $type;
- if (isset($data)) {
- $this->set($data);
- }
- }
-
- public function info() {
- return $this->info;
- }
-
- public function type() {
- return $this->type;
- }
-
- public function value(array $options = array()) {
- if (!$this->dataAvailable() && isset($this->info['parent'])) {
- throw new EntityMetadataWrapperException('Missing data values.');
- }
- if (!isset($this->data) && isset($this->info['name'])) {
- $this->data = $this->info['parent']->getPropertyValue($this->info['name'], $this->info);
- }
- return $this->data;
- }
-
- public function raw() {
- if (!$this->dataAvailable()) {
- throw new EntityMetadataWrapperException('Missing data values.');
- }
- if (isset($this->info['name']) && isset($this->info['parent'])) {
- return $this->info['parent']->getPropertyRaw($this->info['name'], $this->info);
- }
-
- return $this->value();
- }
-
- protected function dataAvailable() {
- return isset($this->data) || (isset($this->info['parent']) && $this->info['parent']->dataAvailable());
- }
-
- public function set($value) {
- if (!$this->validate($value)) {
- throw new EntityMetadataWrapperException('Invalid data value given. Be sure it matches the required data type and format.');
- }
- $this->clear();
- $this->data = $value;
- $this->updateParent($value);
- return $this;
- }
-
- protected function updateParent($value) {
- if (isset($this->info['parent'])) {
- $this->info['parent']->setProperty($this->info['name'], $value);
- }
- }
-
- public function validate($value) {
- if (isset($value) && !entity_property_verify_data_type($value, $this->type)) {
- return FALSE;
- }
-
-
- if (isset($this->info['parent']) && $this->info['parent'] instanceof EntityListWrapper) {
- return TRUE;
- }
- if (!isset($value) && !empty($this->info['required'])) {
-
- return FALSE;
- }
- return !isset($this->info['validation callback']) || call_user_func($this->info['validation callback'], $value, $this->info);
- }
- public function __toString() {
- return isset($this->info) ? 'Property ' . $this->info['name'] : $this->type;
- }
-
- protected function clear() {
- $this->data = NULL;
- foreach ($this->cache as $wrapper) {
- $wrapper->clear();
- }
- }
-
- public function optionsList($op = 'edit') {
- if (isset($this->info['options list']) && is_callable($this->info['options list'])) {
- $name = isset($this->info['name']) ? $this->info['name'] : NULL;
- return call_user_func($this->info['options list'], $name, $this->info, $op);
- }
- return FALSE;
- }
-
- public function label() {
- if ($options = $this->optionsList('view')) {
- $options = entity_property_options_flatten($options);
- $value = $this->value();
- if (is_scalar($value) && isset($options[$value])) {
- return $options[$value];
- }
- }
- }
-
- public function access($op, $account = NULL) {
- return !empty($this->info['parent']) ? $this->info['parent']->propertyAccess($this->info['name'], $op, $account) : TRUE;
- }
-
- public function __sleep() {
- $vars = get_object_vars($this);
- unset($vars['cache']);
- return drupal_map_assoc(array_keys($vars));
- }
- }
- class EntityValueWrapper extends EntityMetadataWrapper {
-
- public function value(array $options = array()) {
- $data = parent::value();
- if ($this->type == 'text' && isset($data)) {
- $info = $this->info + array('sanitized' => FALSE, 'sanitize' => 'check_plain');
- $options += array('sanitize' => FALSE, 'decode' => FALSE);
- if ($options['sanitize'] && !$info['sanitized']) {
- return call_user_func($info['sanitize'], $data);
- }
- elseif ($options['decode'] && $info['sanitized']) {
- return decode_entities(strip_tags($data));
- }
- }
- return $data;
- }
- }
- class EntityStructureWrapper extends EntityMetadataWrapper implements IteratorAggregate {
- protected $propertyInfo = array(), $propertyInfoAltered = FALSE;
- protected $langcode = LANGUAGE_NONE;
- protected $propertyInfoDefaults = array(
- 'type' => 'text',
- 'getter callback' => 'entity_property_verbatim_get',
- 'clear' => array(),
- );
-
- public function __construct($type, $data = NULL, $info = array()) {
- parent::__construct($type, $data, $info);
- $this->info += array('property defaults' => array());
- $info += array('property info' => array());
- $this->propertyInfo['properties'] = $info['property info'];
- }
-
- protected function spotInfo() {
-
- if (!empty($this->info['property info alter']) && !$this->propertyInfoAltered) {
- $this->propertyInfo = call_user_func($this->info['property info alter'], $this, $this->propertyInfo);
- $this->propertyInfoAltered = TRUE;
- }
- }
-
- public function getPropertyInfo($name = NULL) {
- $this->spotInfo();
- if (!isset($name)) {
- return $this->propertyInfo['properties'];
- }
- if (!isset($this->propertyInfo['properties'][$name])) {
- throw new EntityMetadataWrapperException('Unknown data property ' . check_plain($name) . '.');
- }
- return $this->propertyInfo['properties'][$name] + $this->info['property defaults'] + $this->propertyInfoDefaults;
- }
-
- public function &refPropertyInfo() {
- return $this->propertyInfo;
- }
-
- public function language($langcode = LANGUAGE_NONE) {
- if ($langcode != $this->langcode) {
- $this->langcode = $langcode;
- $this->cache = array();
- }
- return $this;
- }
-
- public function getPropertyLanguage() {
- if ($this->langcode != LANGUAGE_NONE && $list = language_list()) {
- if (isset($list[$this->langcode])) {
- return $list[$this->langcode];
- }
- }
- return NULL;
- }
-
- public function get($name) {
-
- if (!array_key_exists($name, $this->cache)) {
- if ($info = $this->getPropertyInfo($name)) {
- $info += array('parent' => $this, 'name' => $name, 'langcode' => $this->langcode, 'property defaults' => array());
- $info['property defaults'] += $this->info['property defaults'];
- $this->cache[$name] = entity_metadata_wrapper($info['type'], NULL, $info);
- }
- else {
- throw new EntityMetadataWrapperException('There is no property ' . check_plain($name) . " for this entity.");
- }
- }
- return $this->cache[$name];
- }
-
- public function __get($name) {
- if (strpos($name, 'krumo') === 0) {
-
-
- return NULL;
- }
- $get = $this->get($name);
- return $get;
- }
-
- public function __set($name, $value) {
- if (strpos($name, 'krumo') === 0) {
-
-
- $this->$name = $value;
- }
- else {
- $this->get($name)->set($value);
- }
- }
-
- protected function getPropertyValue($name, &$info) {
- $options = array('language' => $this->getPropertyLanguage(), 'absolute' => TRUE);
- $data = $this->value();
- if (!isset($data)) {
- throw new EntityMetadataWrapperException('Unable to get the data property ' . check_plain($name) . ' as the parent data structure is not set.');
- }
- return $info['getter callback']($data, $options, $name, $this->type, $info);
- }
-
- protected function getPropertyRaw($name, &$info) {
- if (!empty($info['raw getter callback'])) {
- $options = array('language' => $this->getPropertyLanguage(), 'absolute' => TRUE);
- $data = $this->value();
- if (!isset($data)) {
- throw new EntityMetadataWrapperException('Unable to get the data property ' . check_plain($name) . ' as the parent data structure is not set.');
- }
- return $info['raw getter callback']($data, $options, $name, $this->type, $info);
- }
- return $this->getPropertyValue($name, $info);
- }
-
- protected function setProperty($name, $value) {
- $info = $this->getPropertyInfo($name);
- if (!empty($info['setter callback'])) {
- $data = $this->value();
-
-
- if (!isset($data)) {
- if (!empty($this->info['auto creation']) && !($this instanceof EntityDrupalWrapper)) {
- $data = $this->info['auto creation']($name, $this->info);
- }
- else {
- throw new EntityMetadataWrapperException('Unable to set the data property ' . check_plain($name) . ' as the parent data structure is not set.');
- }
- }
-
- $info['setter callback']($data, $name, $value, $this->langcode, $this->type, $info);
-
-
- $data = $this->info['type'] == 'entity' ? $this : $data;
- $this->set($data);
-
- foreach ($info['clear'] as $name) {
- if (isset($this->cache[$name])) {
- $this->cache[$name]->clear();
- }
- }
- }
- else {
- throw new EntityMetadataWrapperException('Entity property ' . check_plain($name) . " doesn't support writing.");
- }
- }
- protected function propertyAccess($name, $op, $account = NULL) {
- $info = $this->getPropertyInfo($name);
-
-
- if ($op == 'edit') {
- $entity = $this;
- while (!($entity instanceof EntityDrupalWrapper) && isset($entity->info['parent'])) {
- $entity = $entity->info['parent'];
- }
- if ($entity instanceof EntityDrupalWrapper && !$entity->entityAccess('update', $account)) {
- return FALSE;
- }
- }
- if (!empty($info['access callback'])) {
- $data = $this->dataAvailable() ? $this->value() : NULL;
- return call_user_func($info['access callback'], $op, $name, $data, $account, $this->type);
- }
- elseif ($op == 'edit' && isset($info['setter permission'])) {
- return user_access($info['setter permission'], $account);
- }
- return TRUE;
- }
-
- public function __isset($name) {
- $this->spotInfo();
- return isset($this->propertyInfo['properties'][$name]);
- }
- public function getIterator() {
- $this->spotInfo();
- return new EntityMetadataWrapperIterator($this, array_keys($this->propertyInfo['properties']));
- }
-
- public function getIdentifier() {
- return isset($this->id) && $this->dataAvailable() ? $this->id->value() : NULL;
- }
-
- public function __sleep() {
- $vars = parent::__sleep();
- unset($vars['propertyInfoDefaults']);
- return $vars;
- }
- public function clear() {
- $this->propertyInfoAltered = FALSE;
- parent::clear();
- }
- }
- class EntityDrupalWrapper extends EntityStructureWrapper {
-
- protected $id = FALSE;
- protected $bundle;
- protected $entityInfo;
-
- public function __construct($type, $data = NULL, $info = array()) {
- parent::__construct($type, $data, $info);
- $this->setUp();
- }
- protected function setUp() {
- $this->propertyInfo = entity_get_property_info($this->type) + array('properties' => array());
- $info = $this->info + array('property info' => array(), 'bundle' => NULL);
- $this->propertyInfo['properties'] += $info['property info'];
- $this->bundle = $info['bundle'];
- $this->entityInfo = entity_get_info($this->type);
- if (isset($this->bundle)) {
- $this->spotBundleInfo(FALSE);
- }
- }
-
- protected function setEntity($data) {
-
-
- if (isset($data) && $data !== FALSE && !is_object($data)) {
- $this->id = $data;
- $this->data = FALSE;
- }
- elseif (is_object($data) && $data instanceof EntityDrupalWrapper) {
-
- $this->id = $data->id;
- $this->data = $data->data;
-
- if ($this->info['type'] == 'entity') {
- $this->type = $data->type;
- }
- }
- elseif (is_object($data)) {
-
- $this->data = $data;
- $id = entity_id($this->type, $data);
- $this->id = isset($id) ? $id : FALSE;
- }
- else {
- $this->id = FALSE;
- $this->data = NULL;
- }
- }
-
- protected function spotInfo() {
- if (!$this->propertyInfoAltered) {
- if ($this->info['type'] == 'entity' && $this->dataAvailable() && $this->value()) {
-
- $this->setUp();
- }
- $this->spotBundleInfo(TRUE);
- parent::spotInfo();
- $this->propertyInfoAltered = TRUE;
- }
- }
-
- protected function spotBundleInfo($load = TRUE) {
-
- if (empty($this->entityInfo['entity keys']['bundle']) && $this->type != 'entity') {
- $this->bundle = $this->type;
- }
-
- elseif (!$this->bundle && $load && $this->dataAvailable()) {
- try {
- if ($entity = $this->value()) {
- list($id, $vid, $bundle) = entity_extract_ids($this->type, $entity);
- $this->bundle = $bundle;
- }
- }
- catch (EntityMetadataWrapperException $e) {
-
- }
- }
- if ($this->bundle && isset($this->propertyInfo['bundles'][$this->bundle])) {
- $bundle_info = (array) $this->propertyInfo['bundles'][$this->bundle] + array('properties' => array());
-
-
-
- $this->propertyInfo['properties'] = $bundle_info['properties'] + $this->propertyInfo['properties'];
- }
- }
-
- public function getIdentifier() {
- return $this->dataAvailable() ? $this->value(array('identifier' => TRUE)) : NULL;
- }
-
- public function getBundle() {
- if ($this->dataAvailable()) {
- $this->spotInfo();
- return $this->bundle;
- }
- }
-
- public function value(array $options = array()) {
-
- if (!isset($this->data)) {
- $this->setEntity(parent::value());
- }
- if (!empty($options['identifier'])) {
- return $this->id;
- }
- elseif (!$this->data && !empty($this->id)) {
-
- $return = entity_load($this->type, array($this->id));
-
-
- $this->data = $return ? reset($return) : NULL;
- }
- return $this->data;
- }
-
- public function view($view_mode = 'full', $langcode = NULL, $page = NULL) {
- return entity_view($this->type(), array($this->value()), $view_mode, $langcode, $page);
- }
-
- public function set($value) {
- if (!$this->validate($value)) {
- throw new EntityMetadataWrapperException('Invalid data value given. Be sure it matches the required data type and format.');
- }
- if ($this->info['type'] == 'entity' && $value === $this) {
-
- return $this;
- }
- $previous_id = $this->id;
- $previous_type = $this->type;
-
- $this->clear();
- $this->setEntity($value);
-
-
-
- if ($this->info['type'] == 'entity' && ($previous_id != $this->id || $previous_type != $this->type)) {
-
-
- $this->updateParent(clone $this);
- }
-
-
-
- elseif ($this->id === FALSE && !$this->data) {
- $this->updateParent(NULL);
- }
- elseif ($previous_id !== $this->id) {
- $this->updateParent($this->id);
- }
- return $this;
- }
-
- public function clear() {
- $this->id = NULL;
- $this->bundle = isset($this->info['bundle']) ? $this->info['bundle'] : NULL;
- if ($this->type != $this->info['type']) {
-
-
- $this->type = $this->info['type'];
- $this->setUp();
- }
- parent::clear();
- }
-
- public function type() {
-
-
- if ($this->dataAvailable() && $this->info['type'] == 'entity') {
- try {
- $this->value(array('identifier' => TRUE));
- }
- catch (EntityMetadataWrapperException $e) {
-
- }
- }
- return $this->type;
- }
-
- public function access($op, $account = NULL) {
- if (!empty($this->info['parent'])) {
-
-
- return $this->entityAccess('view', $account) && parent::access($op, $account);
- }
- else {
-
- return $this->entityAccess($op == 'edit' ? 'update' : 'view', $account);
- }
- }
-
- public function entityAccess($op, $account = NULL) {
- $entity = $this->dataAvailable() ? $this->value() : NULL;
-
-
-
- if ($entity === FALSE) {
- $entity = NULL;
- }
- return entity_access($op, $this->type, $entity, $account);
- }
-
- public function save() {
- if ($this->data) {
- if (!entity_type_supports($this->type, 'save')) {
- throw new EntityMetadataWrapperException("There is no information about how to save entities of type " . check_plain($this->type) . '.');
- }
- entity_save($this->type, $this->data);
-
- if (!$this->id) {
- list($this->id, , ) = entity_extract_ids($this->type, $this->data);
- }
- }
-
- return $this;
- }
-
- public function delete() {
- if ($this->dataAvailable() && $this->value()) {
- $return = entity_delete($this->type, $this->id);
- if ($return === FALSE) {
- throw new EntityMetadataWrapperException("There is no information about how to delete entities of type " . check_plain($this->type) . '.');
- }
- }
- return $this;
- }
-
- public function entityInfo() {
- return $this->entityInfo;
- }
-
- public function entityKey($name) {
- return isset($this->entityInfo['entity keys'][$name]) ? $this->entityInfo['entity keys'][$name] : FALSE;
- }
-
- public function label() {
- if ($entity = $this->value()) {
- return entity_label($this->type, $entity);
- }
- }
-
- public function __sleep() {
- $vars = parent::__sleep();
-
- unset($vars['data'], $vars['propertyInfo'], $vars['propertyInfoAltered'], $vars['entityInfo']);
-
- if ($this->dataAvailable() && $this->id === FALSE) {
- $vars['data'] = 'data';
- }
- return $vars;
- }
- public function __wakeup() {
- $this->setUp();
- if ($this->id !== FALSE) {
-
- $this->data = FALSE;
- }
- }
- }
- class EntityListWrapper extends EntityMetadataWrapper implements IteratorAggregate, ArrayAccess, Countable {
-
- protected $itemType;
-
- protected $isEntityList;
- public function __construct($type, $data = NULL, $info = array()) {
- parent::__construct($type, NULL, $info);
- $this->itemType = entity_property_list_extract_type($this->type);
- if (!$this->itemType) {
- $this->itemType = 'unknown';
- }
- $this->isEntityList = (bool) entity_get_info($this->itemType);
- if (isset($data)) {
- $this->set($data);
- }
- }
-
- public function get($delta) {
-
- if (!array_key_exists($delta, $this->cache)) {
- if (!isset($delta)) {
-
- $values = parent::value();
- $delta = $values ? max(array_keys($values)) + 1 : 0;
- }
- if (is_numeric($delta)) {
- $info = array('parent' => $this, 'name' => $delta) + $this->info;
- $this->cache[$delta] = entity_metadata_wrapper($this->itemType, NULL, $info);
- }
- else {
- throw new EntityMetadataWrapperException('There can be only numerical keyed items in a list.');
- }
- }
- return $this->cache[$delta];
- }
- protected function getPropertyValue($delta) {
-
- $data = parent::value();
- if (isset($data[$delta])) {
- return $data[$delta];
- }
- }
- protected function getPropertyRaw($delta) {
- return $this->getPropertyValue($delta);
- }
- protected function setProperty($delta, $value) {
- $data = parent::value();
- if (is_numeric($delta)) {
- $data[$delta] = $value;
- $this->set($data);
- }
- }
- protected function propertyAccess($delta, $op, $account = NULL) {
- return $this->access($op, $account);
- }
-
- public function value(array $options = array()) {
-
-
- if ($this->isEntityList && empty($options['identifier']) && $this->dataAvailable()) {
- $list = parent::value();
- $entities = $list ? entity_load($this->get(0)->type, $list) : array();
-
- foreach ($list as $key => $id) {
-
-
- $list[$key] = isset($entities[$id]) ? $entities[$id] : NULL;
- }
- return $list;
- }
- return parent::value();
- }
- public function set($values) {
-
- if ($this->isEntityList && $values && is_object(reset($values))) {
- foreach ($values as $key => $value) {
-
- if (isset($value)) {
- list($id, $vid, $bundle) = entity_extract_ids($this->itemType, $value);
- $values[$key] = $id;
- }
- }
- }
- return parent::set($values);
- }
-
- public function getIterator() {
-
- return new EntityMetadataWrapperIterator($this, $this->dataAvailable() ? array_keys(parent::value()) : array(0));
- }
-
- public function offsetGet($delta) {
- return $this->get($delta);
- }
- public function offsetExists($delta) {
- return $this->dataAvailable() && ($data = $this->value()) && array_key_exists($delta, $data);
- }
- public function offsetSet($delta, $value) {
- $this->get($delta)->set($value);
- }
- public function offsetUnset($delta) {
- if ($this->offsetExists($delta)) {
- unset($this->data[$delta]);
- $this->set($this->data);
- }
- }
- public function count() {
- return $this->dataAvailable() ? count($this->value()) : 0;
- }
-
- public function validate($value) {
-
- if (!empty($this->info['required']) && empty($value)) {
- return FALSE;
- }
- return parent::validate($value);
- }
-
- public function label() {
- if ($options = $this->optionsList('view')) {
- $options = entity_property_options_flatten($options);
- $labels = array_intersect_key($options, array_flip((array) parent::value()));
- }
- else {
-
-
- $labels = array();
- foreach ($this as $key => $property) {
- $label = $property->label();
- if (!$label) {
- return NULL;
- }
- $labels[] = $label;
- }
- }
- return isset($labels) ? implode(', ', $labels) : NULL;
- }
- }
- class EntityMetadataWrapperException extends Exception { }
- class EntityMetadataWrapperIterator implements RecursiveIterator {
- protected $position = 0;
- protected $wrapper, $keys;
- public function __construct(EntityMetadataWrapper $wrapper, array $keys) {
- $this->wrapper = $wrapper;
- $this->keys = $keys;
- }
- function rewind() {
- $this->position = 0;
- }
- function current() {
- return $this->wrapper->get($this->keys[$this->position]);
- }
- function key() {
- return $this->keys[$this->position];
- }
- function next() {
- $this->position++;
- }
- function valid() {
- return isset($this->keys[$this->position]);
- }
- public function hasChildren() {
- return $this->current() instanceof IteratorAggregate;
- }
- public function getChildren() {
- return $this->current()->getIterator();
- }
- }
- class EntityMetadataArrayObject implements ArrayAccess, Countable, IteratorAggregate {
- protected $data;
- public function __construct(&$array) {
- $this->data =& $array;
- }
- public function &getArray() {
- return $this->data;
- }
-
- 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);
- }
- }
|