Class ResultIterator extends \ArrayIterator {
public function __construct($_array,$object){
if(is_array($_array) && count($_array)>0) {
foreach ($_array as $v){
$value=Util::ArrayToClass($object,$v);
$this->append($value);
unset($value);
}
}
var_dump($this);
}
}
bject(OpswatPHP\ResultIterator)#784 (1) {
["storage":"ArrayIterator":private]=>
array(10) {
[0]=>
object(OpswatPHP\Group\GroupResult)#59 (10) {
["group_id":"OpswatPHP\Group\GroupResult":private]=>
string(9) "103455134"
["group_name":"OpswatPHP\Group\GroupResult":private]=>
string(15) "[EXT] Customers"
}
[1]=>
object(OpswatPHP\Group\GroupResult)#59 (10) {
["group_id":"OpswatPHP\Group\GroupResult":private]=>
string(9) "103455134"
["group_name":"OpswatPHP\Group\GroupResult":private]=>
string(15) "[EXT] Customers"
....
}
public function __construct($_array,$object){
if(is_array($_array) && count($_array)>0) {
foreach ($_array as $v){
$value=Util::ArrayToClass($object,$v);
$this->append($value);
var_dump($value);
unset($value);
}
}
}
object(OpswatPHP\Group\GroupResult)#59 (10) {
["group_id":"OpswatPHP\Group\GroupResult":private]=>
string(22) "0051a00000393LXdefault"
["group_name":"OpswatPHP\Group\GroupResult":private]=>
string(7) "Default"
}
object(OpswatPHP\Group\GroupResult)#59 (10) {
["group_id":"OpswatPHP\Group\GroupResult":private]=>
string(9) "226066674"
["group_name":"OpswatPHP\Group\GroupResult":private]=>
string(9) "[ZZZ] XXX"
}
class ResultIterator extends \ArrayIterator
{
public function __construct(array $array, object $object)
{
foreach ($array as $value) {
$this->append(Util::ArrayToClass(clone $object, $value));
}
}
}