* echo R::dump( $bean ); * * * The example shows how to echo the result of a simple * dump. This will print the string representation of the * specified bean to the screen, limiting the output per bean * to 35 characters to improve readability. Nested beans will * also be dumped. * * @param OODBBean|array $data either a bean or an array of beans * * @return array */ public static function dump( $data ) { $array = array(); if ( $data instanceof OODBBean ) { $str = strval( $data ); if (strlen($str) > 35) { $beanStr = substr( $str, 0, 35 ).'... '; } else { $beanStr = $str; } return $beanStr; } if ( is_array( $data ) ) { foreach( $data as $key => $item ) { $array[$key] = self::dump( $item ); } } return $array; } }