| @@ 370-383 (lines=14) @@ | ||
| 367 | foreach ( $info as $key => $value ) { |
|
| 368 | if ( is_array( $value ) ) { |
|
| 369 | $info[ $key ] = self::strip_objects( $value ); |
|
| 370 | } else if ( is_object( $value ) ) { |
|
| 371 | $object_class = get_class( $value ); |
|
| 372 | $info[ $object_class ] = array(); |
|
| 373 | $info[ $object_class ][ 'ID' ] = method_exists( $value, 'ID' ) ? $value->ID() : spl_object_hash( $value ); |
|
| 374 | if ( method_exists( $value, 'ID' ) ) { |
|
| 375 | $info[ $object_class ][ 'ID' ] = $value->ID(); |
|
| 376 | } |
|
| 377 | if ( method_exists( $value, 'status' ) ) { |
|
| 378 | $info[ $object_class ][ 'status' ] = $value->status(); |
|
| 379 | } else if ( method_exists( $value, 'status_ID' ) ) { |
|
| 380 | $info[ $object_class ][ 'status' ] = $value->status_ID(); |
|
| 381 | } |
|
| 382 | unset( $info[ $key ] ); |
|
| 383 | } |
|
| 384 | } |
|
| 385 | return (array)$info; |
|
| 386 | } |
|
| @@ 1237-1249 (lines=13) @@ | ||
| 1234 | */ |
|
| 1235 | function _strip_objects( $info = array() ) { |
|
| 1236 | foreach ( $info as $key => $value ) { |
|
| 1237 | if ( is_array( $value )) { |
|
| 1238 | $info[ $key ] = $this->_strip_objects( $value ); |
|
| 1239 | } else if ( is_object( $value ) ) { |
|
| 1240 | $object_class = get_class( $value ); |
|
| 1241 | $info[ $object_class ] = array(); |
|
| 1242 | $info[ $object_class ][ 'ID' ] = method_exists( $value, 'ID' ) ? $value->ID() : 0; |
|
| 1243 | if ( method_exists( $value, 'status' ) ) { |
|
| 1244 | $info[ $object_class ][ 'status' ] = $value->status(); |
|
| 1245 | } else if ( method_exists( $value, 'status_ID' ) ) { |
|
| 1246 | $info[ $object_class ][ 'status' ] = $value->status_ID(); |
|
| 1247 | } |
|
| 1248 | unset( $info[ $key ] ); |
|
| 1249 | } |
|
| 1250 | } |
|
| 1251 | return (array)$info; |
|
| 1252 | } |
|