Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

createQueryBuilder "join" autocompletion not working #2260

Open
HWesterhof opened this issue Dec 4, 2023 · 0 comments
Open

createQueryBuilder "join" autocompletion not working #2260

HWesterhof opened this issue Dec 4, 2023 · 0 comments
Labels

Comments

@HWesterhof
Copy link

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:

image

But it is NOT able to see it when defining a join:

image

Haehnchen added a commit that referenced this issue Apr 17, 2024
#2260 support "targetEntity" extraction from property type for Doctrine relations
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants