Bug #44049

runDql() method in Doctrine\Service handles constant incorrectly

Added by Adrian Föder almost 9 years ago. Updated almost 9 years ago.

Status:
Resolved
Priority:
Must have
Assignee:
Category:
Persistence
Start date:
2012-12-17
Due date:
% Done:

100%

Estimated time:
PHP Version:
Has patch:
No
Complexity:

Description

The method looks like

    public function runDql($dql, $hydrationMode = \Doctrine\ORM\Query::HYDRATE_OBJECT, $firstResult = NULL, $maxResult = NULL) {
        ...

        return $query->execute(array(), constant($hydrationMode));
    }

Since $hydrationMode is obviously intended to be a constant, hence an integer, the invokation of constant($hydrationMode) results appopriately in Warning: constant(): Couldn't find constant 2

This never seems to happen in usual context because it's passed as a string in the Command.

Also available in: Atom PDF