X-Git-Url: http://git.onelab.eu/?p=plcapi.git;a=blobdiff_plain;f=src%2FValue.php;h=84f04d1a7f6181af0993aa3d1ce42d62d2f3f10f;hp=6e8d7efa6f12d46f62b166659a9012b30f439186;hb=cc67a43993662a5a3f92801b96b89ee6e3998532;hpb=751f9c979bd0d3ca2198ad31009d4cb4cff691cc diff --git a/src/Value.php b/src/Value.php index 6e8d7ef..84f04d1 100644 --- a/src/Value.php +++ b/src/Value.php @@ -344,6 +344,7 @@ class Value implements \Countable, \IteratorAggregate /** * Reset internal pointer for xmlrpc values of type struct. + * @deprecated iterate directly over the object using foreach instead */ public function structreset() { @@ -354,6 +355,8 @@ class Value implements \Countable, \IteratorAggregate * Return next member element for xmlrpc values of type struct. * * @return Value + * + * @deprecated iterate directly over the object using foreach instead */ public function structeach() { @@ -419,7 +422,7 @@ class Value implements \Countable, \IteratorAggregate * * @return integer * - * @deprecateduse count() instead + * @deprecated use count() instead */ public function structsize() { @@ -454,6 +457,16 @@ class Value implements \Countable, \IteratorAggregate * @return ArrayIterator */ public function getIterator() { - return new \ArrayIterator($this->me); + switch ($this->mytype) { + case 3: + return new \ArrayIterator($this->me['struct']); + case 2: + return new \ArrayIterator($this->me['array']); + case 1: + return new \ArrayIterator($this->me); + default: + return new \ArrayIterator(); + } + return new \ArrayIterator(); } } \ No newline at end of file