protected function _object_to_array($object)
{
if (!is_object($object)) {
return $object;
}
$array = array();
foreach (get_object_vars($object) as $key => $val) {
// There are some built in keys we need to ignore for this conversion
if (!is_object($val) && !is_array($val) && $key !== '_parent_name') {
$array[$key] = $val;
}
}
return $array;
}