Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3.0 - QueryBuilder - multi-select is not supported #11241

Closed
ondrejmirtes opened this issue Feb 9, 2024 · 0 comments · Fixed by #11242
Closed

3.0 - QueryBuilder - multi-select is not supported #11241

ondrejmirtes opened this issue Feb 9, 2024 · 0 comments · Fixed by #11242

Comments

@ondrejmirtes
Copy link
Contributor

Bug Report

Q A
BC Break yes
Version 3.0

Summary

I'm working on ORM 3 and DBAL 4 support on phpstan-doctrine, and I have this test case:

		$this->entityManager->createQueryBuilder()
			->select([
				'e.id',
				'e.title',
			])->from(MyEntity::class, 'e')
			->getQuery();

When this method is called, Doctrine crashes with: Cannot use "::class" on array originating here:

This is how $select looks like when coming into new Expr\Select($select):

array(1) {
  [0]=>
  array(2) {
    [0]=>
    string(4) "e.id"
    [1]=>
    string(7) "e.title"
  }
}

Current behavior

The method throws an exception.

Expected behavior

It should work because even current 3.0 documentation mentions the possibility to pass arrays into the select method: https://www.doctrine-project.org/projects/doctrine-orm/en/3.0/reference/query-builder.html#high-level-api-methods

ondrejmirtes added a commit to phpstan/phpstan-doctrine that referenced this issue Feb 9, 2024
ondrejmirtes added a commit to phpstan/phpstan-doctrine that referenced this issue Feb 9, 2024
ondrejmirtes added a commit to phpstan/phpstan-doctrine that referenced this issue Feb 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant