| @@ 1259-1271 (lines=13) @@ | ||
| 1256 | */ |
|
| 1257 | public function _strip_objects( $info = array() ) { |
|
| 1258 | foreach ( (array)$info as $key => $value ) { |
|
| 1259 | if ( is_array( $value )) { |
|
| 1260 | $info[ $key ] = $this->_strip_objects( $value ); |
|
| 1261 | } else if ( is_object( $value ) ) { |
|
| 1262 | $object_class = get_class( $value ); |
|
| 1263 | $info[ $object_class ] = array(); |
|
| 1264 | $info[ $object_class ][ 'ID' ] = method_exists( $value, 'ID' ) ? $value->ID() : 0; |
|
| 1265 | if ( method_exists( $value, 'status' ) ) { |
|
| 1266 | $info[ $object_class ][ 'status' ] = $value->status(); |
|
| 1267 | } else if ( method_exists( $value, 'status_ID' ) ) { |
|
| 1268 | $info[ $object_class ][ 'status' ] = $value->status_ID(); |
|
| 1269 | } |
|
| 1270 | unset( $info[ $key ] ); |
|
| 1271 | } |
|
| 1272 | } |
|
| 1273 | return (array)$info; |
|
| 1274 | } |
|
| @@ 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 | } |
|