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.

void
setResultSetMapping(ResultSetMapping $rsm)

Sets the ResultSetMapping of the parsed query.

void
setSqlExecutor(AbstractSqlExecutor $executor)

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

getSqlExecutor()

Gets the SQL executor used by this ParserResult.

void
addParameterMapping(string|integer $dqlPosition, integer $sqlPosition)

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

array
getParameterMappings()

Gets all DQL to SQL parameter mappings.

array
getSqlParameterPositions(string|integer $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.

void setResultSetMapping(ResultSetMapping $rsm)

Sets the ResultSetMapping of the parsed query.

Parameters

ResultSetMapping $rsm

Return Value

void

void setSqlExecutor(AbstractSqlExecutor $executor)

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

Parameters

AbstractSqlExecutor $executor

Return Value

void

AbstractSqlExecutor getSqlExecutor()

Gets the SQL executor used by this ParserResult.

Return Value

AbstractSqlExecutor

void addParameterMapping(string|integer $dqlPosition, integer $sqlPosition)

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

Parameters

string|integer $dqlPosition
integer $sqlPosition

Return Value

void

array getParameterMappings()

Gets all DQL to SQL parameter mappings.

Return Value

array The parameter mappings.

array getSqlParameterPositions(string|integer $dqlPosition)

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

Parameters

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

Return Value

array The positions of the corresponding SQL parameters.