Index: trunk/extensions/Wikidata/OmegaWiki/Record.php |
— | — | @@ -123,11 +123,9 @@ |
124 | 124 | foreach ( $this->values as $key => $value ) { |
125 | 125 | $rv = $comma; |
126 | 126 | $repr = "$key:$value"; |
127 | | - # Duck typing (should refactor this to a has_attr() function); |
128 | | - # ( might be replacable by property_exists() in php 5.1+ ) |
129 | | - $methods = get_class_methods( get_class( $value ) ); |
130 | | - if ( !is_null( $methods ) ) { |
131 | | - if ( in_array( "tostring_indent", $methods ) ) { |
| 127 | + // $value is never a class?? |
| 128 | + if ( gettype ( $value ) == "object" ) { |
| 129 | + if ( property_exists ( $value , 'tostring_indent' ) ) { |
132 | 130 | $repr = $value->tostring_indent( $depth + 1, $key ); |
133 | 131 | } |
134 | 132 | } |