DoctrineExtension
extends AbstractExtension
in package
This class contains the needed functions in order to do the query highlighting
Table of Contents
Properties
Methods
- formatQuery() : string
- Formats and/or highlights the given SQL statement.
- formatSql() : string
- getFilters() : array<string|int, TwigFilter>
- Define our functions
- getFunctions() : array<string|int, TwigFunction>
- Returns a list of functions to add to the existing list.
- getName() : string
- Get the name of the extension
- getNodeVisitors() : array<string|int, NodeVisitorInterface>
- Returns the node visitor instances to add to the existing list.
- getOperators() : array<string|int, array<string|int, mixed>>
- Returns a list of operators to add to the existing list.
- getTests() : array<string|int, TwigTest>
- Returns a list of tests to add to the existing list.
- getTokenParsers() : array<string|int, TokenParserInterface>
- Returns the token parser instances to add to the existing list.
- prettifySql() : string
- replaceQueryParameters() : string
- Return a query with the parameters replaced
- setUpSqlFormatter() : void
Properties
$sqlFormatter
private
SqlFormatter
$sqlFormatter
Methods
formatQuery()
Formats and/or highlights the given SQL statement.
public
formatQuery(string $sql[, bool $highlightOnly = false ]) : string
Parameters
- $sql : string
- $highlightOnly : bool = false
-
If true the query is not formatted, just highlighted
Return values
stringformatSql()
public
formatSql(string $sql, bool $highlight) : string
Parameters
- $sql : string
- $highlight : bool
Return values
stringgetFilters()
Define our functions
public
getFilters() : array<string|int, TwigFilter>
Return values
array<string|int, TwigFilter>getFunctions()
Returns a list of functions to add to the existing list.
public
getFunctions() : array<string|int, TwigFunction>
Return values
array<string|int, TwigFunction>getName()
Get the name of the extension
public
getName() : string
Return values
stringgetNodeVisitors()
Returns the node visitor instances to add to the existing list.
public
getNodeVisitors() : array<string|int, NodeVisitorInterface>
Return values
array<string|int, NodeVisitorInterface>getOperators()
Returns a list of operators to add to the existing list.
public
getOperators() : array<string|int, array<string|int, mixed>>
Return values
array<string|int, array<string|int, mixed>> —First array of unary operators, second array of binary operators
getTests()
Returns a list of tests to add to the existing list.
public
getTests() : array<string|int, TwigTest>
Return values
array<string|int, TwigTest>getTokenParsers()
Returns the token parser instances to add to the existing list.
public
getTokenParsers() : array<string|int, TokenParserInterface>
Return values
array<string|int, TokenParserInterface>prettifySql()
public
prettifySql(string $sql) : string
Parameters
- $sql : string
Return values
stringreplaceQueryParameters()
Return a query with the parameters replaced
public
replaceQueryParameters(string $query, array<string|int, mixed>|Data $parameters) : string
Parameters
- $query : string
- $parameters : array<string|int, mixed>|Data
Return values
stringsetUpSqlFormatter()
private
setUpSqlFormatter([bool $highlight = true ][, bool $legacy = false ]) : void
Parameters
- $highlight : bool = true
- $legacy : bool = false