Skip to content

Type infering not working for getSingleScalarResult nor getSingleResult(Query::HYDRATE_SINGLE_SCALAR) #276

Closed
@janedbal

Description

@janedbal

getOneOrNullResult() and getSingleResult() are supported, but only when explicitly specifying the hydration mode

It was stated here that this should be supported, but it seems like the inferred type is mixed. Or did I misunderstood?

$query = $em->createQueryBuilder()
	->addSelect('m.id')
	->from(Many::class, 'm');

assertType(
	'int',
	$query->getQuery()
		// ->getSingleScalarResult()
		->getSingleResult(Query::HYDRATE_SINGLE_SCALAR)
);

Method getSingleColumnResult seems to be not supported as well, is that correct?

cc @arnaud-lb

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