Files
kupshop/bundles/KupShop/DevelopmentBundle/Query/QueryBuilder.php
2025-08-02 16:30:27 +02:00

41 lines
702 B
PHP

<?php
namespace KupShop\DevelopmentBundle\Query;
use Doctrine\DBAL\Connection;
class QueryBuilder extends \Query\QueryBuilder
{
protected static $qb = [];
public function __construct(Connection $connection)
{
self::$qb[] = $this;
parent::__construct($connection);
}
public static function getPendingQueryBuilders()
{
return self::$qb;
}
public function getSQL()
{
$this->markExecuted();
return parent::getSQL();
}
protected function markExecuted()
{
$found = array_search($this, self::$qb);
if ($found === false) {
return;
}
unset(self::$qb[$found]);
}
}