camelot/doctrine-query-sql-formatter

Doctrine ORM Query SQL formatting, with parameters, to make runnable queries

v1.0.0 2019-10-29 12:28 UTC

This package is auto-updated.

Last update: 2021-03-01 00:42:37 UTC


README

Usage

<?php

use Camelot\DoctrineQueryFormatter\QuerySqlFormatter;
use Doctrine\ORM\Query;

/** @var Query $query */

$formatter = new QuerySqlFormatter();
$string = $formatter->replaceQueryParameters($query->getSQL(), $query->getParameters()->toArray());

echo $string;