| @@ 450-463 (lines=14) @@ | ||
| 447 | foreach ( $info as $key => $value ) { |
|
| 448 | if ( is_array( $value ) ) { |
|
| 449 | $info[ $key ] = self::strip_objects( $value ); |
|
| 450 | } else if ( is_object( $value ) ) { |
|
| 451 | $object_class = get_class( $value ); |
|
| 452 | $info[ $object_class ] = array(); |
|
| 453 | $info[ $object_class ][ 'ID' ] = method_exists( $value, 'ID' ) ? $value->ID() : spl_object_hash( $value ); |
|
| 454 | if ( method_exists( $value, 'ID' ) ) { |
|
| 455 | $info[ $object_class ][ 'ID' ] = $value->ID(); |
|
| 456 | } |
|
| 457 | if ( method_exists( $value, 'status' ) ) { |
|
| 458 | $info[ $object_class ][ 'status' ] = $value->status(); |
|
| 459 | } else if ( method_exists( $value, 'status_ID' ) ) { |
|
| 460 | $info[ $object_class ][ 'status' ] = $value->status_ID(); |
|
| 461 | } |
|
| 462 | unset( $info[ $key ] ); |
|
| 463 | } |
|
| 464 | } |
|
| 465 | return (array)$info; |
|
| 466 | } |
|
| @@ 1280-1292 (lines=13) @@ | ||
| 1277 | */ |
|
| 1278 | public function _strip_objects( $info = array() ) { |
|
| 1279 | foreach ( (array)$info as $key => $value ) { |
|
| 1280 | if ( is_array( $value )) { |
|
| 1281 | $info[ $key ] = $this->_strip_objects( $value ); |
|
| 1282 | } else if ( is_object( $value ) ) { |
|
| 1283 | $object_class = get_class( $value ); |
|
| 1284 | $info[ $object_class ] = array(); |
|
| 1285 | $info[ $object_class ][ 'ID' ] = method_exists( $value, 'ID' ) ? $value->ID() : 0; |
|
| 1286 | if ( method_exists( $value, 'status' ) ) { |
|
| 1287 | $info[ $object_class ][ 'status' ] = $value->status(); |
|
| 1288 | } else if ( method_exists( $value, 'status_ID' ) ) { |
|
| 1289 | $info[ $object_class ][ 'status' ] = $value->status_ID(); |
|
| 1290 | } |
|
| 1291 | unset( $info[ $key ] ); |
|
| 1292 | } |
|
| 1293 | } |
|
| 1294 | return (array)$info; |
|
| 1295 | } |
|