PHP code example of camelot / doctrine-query-sql-formatter

1. Go to this page and download the library: Download camelot/doctrine-query-sql-formatter library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

camelot / doctrine-query-sql-formatter example snippets




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

/** @var Query $query */

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

echo $string;