Add this method to you class in order to 'transtypage' all the array properties into stdClass();
Hope it help you.
public function objectThis($object = null) {
if (!$object) {
foreach ($this as $property_name => $property_values) {
if (is_array($property_values)) {
$this->{$property_name} = $this->objectThis($property_values);
}
}
} else {
$object2 = new stdClass();
foreach ($object as $index => $values) {
if (is_array($values)) {
$object2->{$index} = $this->objectThis($values);
} else {
$object2->{$index} = $values;
}
}
return $object2;
}
}