Commit 9f42b875 authored by zYne's avatar zYne

added dump() method

parent d121a4cf
......@@ -453,6 +453,33 @@ final class Doctrine
return true;
}
/**
* dump
*
* dumps a given variable
*
* @param mixed $var a variable of any type
* @return void|string
*/
public static function dump($var)
{
$ret = array();
switch (gettype($var)) {
case 'array':
$ret[] = 'Array(';
foreach ($var as $k => $v) {
$ret[] = $k . ' : ' . Doctrine::dump($v);
}
$ret[] = ')';
break;
case 'object';
$ret[] = 'Object(' . get_class($var) . ')';
break;
default:
$ret[] = var_export($var, true);
}
return implode("\n", $ret);
}
/**
* returns table name from class name
*
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment