class ParserResult (View source)

Encapsulates the resulting components from a DQL query parsing process that can be serialized.

Methods

__construct()

Initializes a new instance of the ParserResult class.

getResultSetMapping()

Gets the ResultSetMapping for the parsed query.

setResultSetMapping(ResultSetMapping $rsm)

Sets the ResultSetMapping of the parsed query.

setSqlExecutor(AbstractSqlExecutor $executor)

Sets the SQL executor that should be used for this ParserResult.

getSqlExecutor()

Gets the SQL executor used by this ParserResult.

addParameterMapping(string|int $dqlPosition, int $sqlPosition)

Adds a DQL to SQL parameter mapping. One DQL parameter name/position can map to several SQL parameter positions.

int[][]
getParameterMappings()

Gets all DQL to SQL parameter mappings.

int[]
getSqlParameterPositions(string|int $dqlPosition)

Gets the SQL parameter positions for a DQL parameter name/position.

Details

__construct()

Initializes a new instance of the ParserResult class.

The new instance is initialized with an empty ResultSetMapping.

ResultSetMapping|null getResultSetMapping()

Gets the ResultSetMapping for the parsed query.

Return Value

ResultSetMapping|null The result set mapping of the parsed query or NULL if the query is not a SELECT query.

setResultSetMapping(ResultSetMapping $rsm)

Sets the ResultSetMapping of the parsed query.

Parameters

ResultSetMapping $rsm

setSqlExecutor(AbstractSqlExecutor $executor)

Sets the SQL executor that should be used for this ParserResult.

Parameters

AbstractSqlExecutor $executor

AbstractSqlExecutor getSqlExecutor()

Gets the SQL executor used by this ParserResult.

Return Value

AbstractSqlExecutor

addParameterMapping(string|int $dqlPosition, int $sqlPosition)

Adds a DQL to SQL parameter mapping. One DQL parameter name/position can map to several SQL parameter positions.

Parameters

string|int $dqlPosition
int $sqlPosition

int[][] getParameterMappings()

Gets all DQL to SQL parameter mappings.

Return Value

int[][] The parameter mappings.

int[] getSqlParameterPositions(string|int $dqlPosition)

Gets the SQL parameter positions for a DQL parameter name/position.

Parameters

string|int $dqlPosition The name or position of the DQL parameter.

Return Value

int[] The positions of the corresponding SQL parameters.