@@ 357-370 (lines=14) @@ | ||
354 | foreach ($info as $key => $value) { |
|
355 | if (is_array($value)) { |
|
356 | $info[$key] = self::strip_objects($value); |
|
357 | } else if (is_object($value)) { |
|
358 | $object_class = get_class($value); |
|
359 | $info[$object_class] = array(); |
|
360 | $info[$object_class]['ID'] = method_exists($value, 'ID') ? $value->ID() : spl_object_hash($value); |
|
361 | if (method_exists($value, 'ID')) { |
|
362 | $info[$object_class]['ID'] = $value->ID(); |
|
363 | } |
|
364 | if (method_exists($value, 'status')) { |
|
365 | $info[$object_class]['status'] = $value->status(); |
|
366 | } else if (method_exists($value, 'status_ID')) { |
|
367 | $info[$object_class]['status'] = $value->status_ID(); |
|
368 | } |
|
369 | unset($info[$key]); |
|
370 | } |
|
371 | } |
|
372 | return (array)$info; |
|
373 | } |
@@ 1297-1309 (lines=13) @@ | ||
1294 | */ |
|
1295 | public function _strip_objects( $info = array() ) { |
|
1296 | foreach ( (array)$info as $key => $value ) { |
|
1297 | if ( is_array( $value )) { |
|
1298 | $info[ $key ] = $this->_strip_objects( $value ); |
|
1299 | } else if ( is_object( $value ) ) { |
|
1300 | $object_class = get_class( $value ); |
|
1301 | $info[ $object_class ] = array(); |
|
1302 | $info[ $object_class ][ 'ID' ] = method_exists( $value, 'ID' ) ? $value->ID() : 0; |
|
1303 | if ( method_exists( $value, 'status' ) ) { |
|
1304 | $info[ $object_class ][ 'status' ] = $value->status(); |
|
1305 | } else if ( method_exists( $value, 'status_ID' ) ) { |
|
1306 | $info[ $object_class ][ 'status' ] = $value->status_ID(); |
|
1307 | } |
|
1308 | unset( $info[ $key ] ); |
|
1309 | } |
|
1310 | } |
|
1311 | return (array)$info; |
|
1312 | } |