1
0
mirror of synced 2024-12-15 15:46:02 +03:00
doctrine2/draft/Doctrine/Query/Printer.php
2007-12-10 20:02:41 +00:00

31 lines
565 B
PHP

<?php
class Doctrine_Query_Printer
{
protected $_indent = 0;
protected $_silent;
public function __construct($silent = false)
{
$this->_silent = $silent;
}
public function startProduction($name)
{
$this->println('(' . $name);
$this->_indent++;
}
public function endProduction()
{
$this->_indent--;
$this->println(')');
}
public function println($str)
{
if ( ! $this->_silent) {
echo str_repeat(' ', $this->_indent), $str, "\n";
}
}
}