@@ 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 | } |
@@ 1225-1237 (lines=13) @@ | ||
1222 | */ |
|
1223 | function _strip_objects( $info = array() ) { |
|
1224 | foreach ( $info as $key => $value ) { |
|
1225 | if ( is_array( $value )) { |
|
1226 | $info[ $key ] = $this->_strip_objects( $value ); |
|
1227 | } else if ( is_object( $value ) ) { |
|
1228 | $object_class = get_class( $value ); |
|
1229 | $info[ $object_class ] = array(); |
|
1230 | $info[ $object_class ][ 'ID' ] = method_exists( $value, 'ID' ) ? $value->ID() : 0; |
|
1231 | if ( method_exists( $value, 'status' ) ) { |
|
1232 | $info[ $object_class ][ 'status' ] = $value->status(); |
|
1233 | } else if ( method_exists( $value, 'status_ID' ) ) { |
|
1234 | $info[ $object_class ][ 'status' ] = $value->status_ID(); |
|
1235 | } |
|
1236 | unset( $info[ $key ] ); |
|
1237 | } |
|
1238 | } |
|
1239 | return (array)$info; |
|
1240 | } |