Skip to content

Not working with doctrine/orm 3.0 and doctrine/lexer 3.0 #104

@Wimble84

Description

@Wimble84

Hi !

Symfony: 7.0.3
Doctrine ORM: 3.0
Doctrine Lexer: 3.0

When trying to use JSON_GET_TEXT on postgres DB like this

public function findAllByRoles(string $role): array 
{
        $qb = $this->createQueryBuilder('u');
        $qb
            ->where("JSON_GET_TEXT(u.roles, 0) = :role")
            ->setParameter('role', $role)
            ->orderBy('u.lastname', 'ASC')
            ->addOrderBy('u.firstname', 'ASC');

        return $qb->getQuery()->getResult();
}

I get this error
Undefined constant Doctrine\ORM\Query\Lexer::T_IDENTIFIER

Before doctrine/orm and doctrine/lexer 3.0, tokens are stored directly as constants. But now (in 3.0) tokens are stored in TokenType Enum

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions