-
Notifications
You must be signed in to change notification settings - Fork 97
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reproduce internal error unsuccessfully
Ref #425
- Loading branch information
1 parent
44e77f0
commit 148fd32
Showing
3 changed files
with
71 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<?php | ||
|
||
namespace QueryResult\CreateQuery; | ||
|
||
use Doctrine\ORM\EntityManager; | ||
use QueryResult\Entities\Bug245Episode; | ||
use QueryResult\Entities\Bug245Segment; | ||
use function PHPStan\Testing\assertType; | ||
|
||
class Foo | ||
{ | ||
|
||
/** @var EntityManager */ | ||
private $em; | ||
|
||
public function doFoo(): void | ||
{ | ||
$result = $this->em->createQueryBuilder() | ||
->select('episode.id') | ||
->from(Bug245Episode::class, 'episode', 'episode.id') | ||
->where('episode.segmentsComplete = false') | ||
->andWhere('0 != SIZE(episode.segments)') | ||
->andWhere( | ||
'0 < (SELECT COUNT(last_segment.id) FROM ' . Bug245Segment::class . ' as last_segment | ||
WHERE last_segment.episode = episode.id AND last_segment.isLastSegment = true)' | ||
) | ||
->andWhere( | ||
"0 = (SELECT COUNT(segment.id) FROM " . Bug245Segment::class . " as segment | ||
WHERE segment.episode = episode.id AND segment.state != 'distributed')" | ||
)->getQuery()->getResult(); | ||
assertType('mixed', $result); | ||
} | ||
|
||
} |
148fd32
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi,
I have the same issue as in #425. I managed to "fix" it by switching to class reference "ClassName::class" instead of "BundleName:Entity" syntax in the
from
clause.I see that the bug reported in 425 uses the "BundleName:Entity" syntax, but here you're using "ClassName::class". Could it be the reason why it's not reproducible?
Best,
Alex