Open
Description
When defining a repository function, the join autocomplete is not working. From earlier versions (both Symfony and PHPStorm), I know this worked before.
I am able to reproduce this on a blank Symfony project.
- PhpStorm version: PhpStorm 2023.2.4 (Build #PS-232.10227.13, built on November 18, 2023)
- Symfony support version 2022.1.261
public function testJoin(User $user)
{
return $this->createQueryBuilder('p')
->join('p.postUser','post_user')
->andWhere('post_user.id = :id')->setParameter('id',$user)
->getQuery()
->getResult();
}
I can reproduce this with a blank Symfony project. composer.json:
{
"type": "project",
"license": "proprietary",
"minimum-stability": "stable",
"prefer-stable": true,
"require": {
"php": ">=8.1",
"ext-ctype": "*",
"ext-iconv": "*",
"doctrine/doctrine-bundle": "^2.11",
"doctrine/doctrine-migrations-bundle": "^3.3",
"doctrine/orm": "^2.17",
"symfony/console": "6.4.*",
"symfony/dotenv": "6.4.*",
"symfony/flex": "^2",
"symfony/framework-bundle": "6.4.*",
"symfony/runtime": "6.4.*",
"symfony/yaml": "6.4.*"
},
"require-dev": {
"symfony/maker-bundle": "^1.52"
},
"config": {
"allow-plugins": {
"php-http/discovery": true,
"symfony/flex": true,
"symfony/runtime": true
},
"sort-packages": true
},
"autoload": {
"psr-4": {
"App\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"App\\Tests\\": "tests/"
}
},
"replace": {
"symfony/polyfill-ctype": "*",
"symfony/polyfill-iconv": "*",
"symfony/polyfill-php72": "*",
"symfony/polyfill-php73": "*",
"symfony/polyfill-php74": "*",
"symfony/polyfill-php80": "*",
"symfony/polyfill-php81": "*"
},
"scripts": {
"auto-scripts": {
"cache:clear": "symfony-cmd",
"assets:install %PUBLIC_DIR%": "symfony-cmd"
},
"post-install-cmd": [
"@auto-scripts"
],
"post-update-cmd": [
"@auto-scripts"
]
},
"conflict": {
"symfony/symfony": "*"
},
"extra": {
"symfony": {
"allow-contrib": false,
"require": "6.4.*"
}
}
}
- Created 2 entities with bin/console make:entity: User and Post
- Defined ManyToOne relationship between User and Post
#[ORM\ManyToOne]
private ?User $postUser = null;
It is able to see the ManyToOne in the autocomplete dialog, in the "where" function:
But it is NOT able to see it when defining a join: