class DoctrineExtension extends Twig_Extension (View source)

This class contains the needed functions in order to do the query highlighting

Methods

Twig_SimpleFilter[]
getFilters()

Define our functions

string
minifyQuery(string $query)

Minify the query

static string
escapeFunction(mixed $parameter)

Escape parameters of a SQL query DON'T USE THIS FUNCTION OUTSIDE ITS INTENDED SCOPE

string
replaceQueryParameters(string $query, array|Data $parameters)

Return a query with the parameters replaced

string
formatQuery(string $sql, bool $highlightOnly = false)

Formats and/or highlights the given SQL statement.

string
getName()

Get the name of the extension

Details

Twig_SimpleFilter[] getFilters()

Define our functions

Return Value

Twig_SimpleFilter[]

string minifyQuery(string $query)

Minify the query

Parameters

string $query

Return Value

string

static string escapeFunction(mixed $parameter)

Escape parameters of a SQL query DON'T USE THIS FUNCTION OUTSIDE ITS INTENDED SCOPE

Parameters

mixed $parameter

Return Value

string

string replaceQueryParameters(string $query, array|Data $parameters)

Return a query with the parameters replaced

Parameters

string $query
array|Data $parameters

Return Value

string

string formatQuery(string $sql, bool $highlightOnly = false)

Formats and/or highlights the given SQL statement.

Parameters

string $sql
bool $highlightOnly If true the query is not formatted, just highlighted

Return Value

string

string getName()

Get the name of the extension

Return Value

string