Why Doctrine\ORM\Query\Expr\From does not extend Base ? #4951

Open
opened 2026-01-22 14:53:57 +01:00 by admin · 1 comment
Owner

Originally created by @morfin on GitHub (Dec 23, 2015).

Originally assigned to: @Ocramius on GitHub.

The QueryBuilder method "add" expects a "Expr\Base" $dqlPart instance according to the method annotations. I just wonder why the annotation is there.

That means:

$qb->add('from', new Expr\From('MyEntity', 'x'))

Will cause PhpStorm and probably other IDE's to throw a syntax warning.

Originally created by @morfin on GitHub (Dec 23, 2015). Originally assigned to: @Ocramius on GitHub. The QueryBuilder method "add" expects a "Expr\Base" $dqlPart instance according to the method annotations. I just wonder why the annotation is there. That means: ``` $qb->add('from', new Expr\From('MyEntity', 'x')) ``` Will cause PhpStorm and probably other IDE's to throw a syntax warning.
admin added the BugDocumentation labels 2026-01-22 14:53:57 +01:00
Author
Owner

@Ocramius commented on GitHub (Dec 25, 2015):

I don't see what you are referring to: 3ca6828544/lib/Doctrine/ORM/QueryBuilder.php (L684)

Could you point me to the exact bit that is causing the warning?

@Ocramius commented on GitHub (Dec 25, 2015): I don't see what you are referring to: https://github.com/doctrine/doctrine2/blob/3ca68285449cbf43a20c2b8383bd82745d68bdb6/lib/Doctrine/ORM/QueryBuilder.php#L684 Could you point me to the exact bit that is causing the warning?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#4951