This is called "arbitrary joins" in DQL:
```php
<?php
$query = $em->createQuery('SELECT u FROM User u JOIN Blacklist b WITH
u.email = b.email');
```
See
https://www.doctrine-project.org/projects/doctrine-orm/en/2.7/reference/dql-doctrine-query-language.html
Marco Pivetta
http://twitter.com/Ocramius
http://ocramius.github.com/
On Fri, Jun 5, 2020 at 12:41 PM Mattia Basaglia <[email protected]>
wrote:
> Let's say I have two entity classes, let's call them EntityA and EntityB.
> In EnityA I have a ManyToOne or something to EntityB.
>
> Can I create a query to get EnrityA objects based on a condition
> referencing their related EntityB without having to manually specify joins?
>
> --
> You received this message because you are subscribed to the Google Groups
> "doctrine-user" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/doctrine-user/1280df0e-b8fb-4391-a15c-5117e3ff3c5do%40googlegroups.com
> <https://groups.google.com/d/msgid/doctrine-user/1280df0e-b8fb-4391-a15c-5117e3ff3c5do%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
--
You received this message because you are subscribed to the Google Groups
"doctrine-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/doctrine-user/CADyq6s%2B3kOBmcjDnuVv7sguhHUVdaPULWFsRQPxj2nv2stXaNQ%40mail.gmail.com.