| @@ 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 | } |
|
| @@ 1294-1306 (lines=13) @@ | ||
| 1291 | */ |
|
| 1292 | public function _strip_objects( $info = array() ) { |
|
| 1293 | foreach ( (array)$info as $key => $value ) { |
|
| 1294 | if ( is_array( $value )) { |
|
| 1295 | $info[ $key ] = $this->_strip_objects( $value ); |
|
| 1296 | } else if ( is_object( $value ) ) { |
|
| 1297 | $object_class = get_class( $value ); |
|
| 1298 | $info[ $object_class ] = array(); |
|
| 1299 | $info[ $object_class ][ 'ID' ] = method_exists( $value, 'ID' ) ? $value->ID() : 0; |
|
| 1300 | if ( method_exists( $value, 'status' ) ) { |
|
| 1301 | $info[ $object_class ][ 'status' ] = $value->status(); |
|
| 1302 | } else if ( method_exists( $value, 'status_ID' ) ) { |
|
| 1303 | $info[ $object_class ][ 'status' ] = $value->status_ID(); |
|
| 1304 | } |
|
| 1305 | unset( $info[ $key ] ); |
|
| 1306 | } |
|
| 1307 | } |
|
| 1308 | return (array)$info; |
|
| 1309 | } |
|