Usually all joined entities are automatically joined and returned by Doctrine. Depending on the fetch (EAGER or LAZY). This is done directly or not. But when you want to filter depending on joined columns, you have to join manually.

You can use strings for this or use the constants provided by Doctrine\ORM\Query\Expr\Join.

    Project::class,    // Entity
    'p',               // Alias
    Join::WITH,        // Join type
    ' = c.project' // Join columns