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

No shortcuts for "Import Class" on ORM relational mappings #125

Open
GDIBass opened this issue Aug 14, 2018 · 0 comments
Open

No shortcuts for "Import Class" on ORM relational mappings #125

GDIBass opened this issue Aug 14, 2018 · 0 comments

Comments

@GDIBass
Copy link

GDIBass commented Aug 14, 2018

Hello,

Currently there is no option shortcuts for "Import Class" when using the Long Form of an entity class.

Example:
Setup: If you have two entities in App\Entity such as App\Entity\Parent and App\Entity\Child.

Parent has the following code:

    /**
     * @ORM\OneToMany(targetEntity="App\Entity\Child\Child", mappedBy="parent")
     */
    private $children;

Child has the following code:

    /**
     * @ORM\ManyToOne(targetEntity="App\Entity\Parent\Parent", inversedBy="children")
     */
    private $parent;

I would like the option to right click the target entity had select "Import Class". The inspector would then add a use statement at the top of the file (along with all the other use statements) like:

use App\Entity\Parent\Parent;

and convert the ORM relation to

    /**
     * @ORM\ManyToOne(targetEntity="Parent", inversedBy="children")
     */
    private $parent;

I'm not very familiar with java, but I'll download the Repo and see if can't get something working! If I can I'll submit a PR and if I can't I'll let you guys know. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant