| @@ 426-439 (lines=14) @@ | ||
| 423 | foreach ( $info as $key => $value ) { |
|
| 424 | if ( is_array( $value ) ) { |
|
| 425 | $info[ $key ] = self::strip_objects( $value ); |
|
| 426 | } else if ( is_object( $value ) ) { |
|
| 427 | $object_class = get_class( $value ); |
|
| 428 | $info[ $object_class ] = array(); |
|
| 429 | $info[ $object_class ][ 'ID' ] = method_exists( $value, 'ID' ) ? $value->ID() : spl_object_hash( $value ); |
|
| 430 | if ( method_exists( $value, 'ID' ) ) { |
|
| 431 | $info[ $object_class ][ 'ID' ] = $value->ID(); |
|
| 432 | } |
|
| 433 | if ( method_exists( $value, 'status' ) ) { |
|
| 434 | $info[ $object_class ][ 'status' ] = $value->status(); |
|
| 435 | } else if ( method_exists( $value, 'status_ID' ) ) { |
|
| 436 | $info[ $object_class ][ 'status' ] = $value->status_ID(); |
|
| 437 | } |
|
| 438 | unset( $info[ $key ] ); |
|
| 439 | } |
|
| 440 | } |
|
| 441 | return (array)$info; |
|
| 442 | } |
|
| @@ 1273-1285 (lines=13) @@ | ||
| 1270 | */ |
|
| 1271 | public function _strip_objects( $info = array() ) { |
|
| 1272 | foreach ( (array)$info as $key => $value ) { |
|
| 1273 | if ( is_array( $value )) { |
|
| 1274 | $info[ $key ] = $this->_strip_objects( $value ); |
|
| 1275 | } else if ( is_object( $value ) ) { |
|
| 1276 | $object_class = get_class( $value ); |
|
| 1277 | $info[ $object_class ] = array(); |
|
| 1278 | $info[ $object_class ][ 'ID' ] = method_exists( $value, 'ID' ) ? $value->ID() : 0; |
|
| 1279 | if ( method_exists( $value, 'status' ) ) { |
|
| 1280 | $info[ $object_class ][ 'status' ] = $value->status(); |
|
| 1281 | } else if ( method_exists( $value, 'status_ID' ) ) { |
|
| 1282 | $info[ $object_class ][ 'status' ] = $value->status_ID(); |
|
| 1283 | } |
|
| 1284 | unset( $info[ $key ] ); |
|
| 1285 | } |
|
| 1286 | } |
|
| 1287 | return (array)$info; |
|
| 1288 | } |
|