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

UndefinedInterfaceMethod-errors for methods in repository #16

Open
cklm opened this issue Jun 7, 2019 · 3 comments
Open

UndefinedInterfaceMethod-errors for methods in repository #16

cklm opened this issue Jun 7, 2019 · 3 comments
Labels

Comments

@cklm
Copy link

cklm commented Jun 7, 2019

Hi, thanks for the great plugin!

I have a question - I'm getting UndefinedInterfaceMethod-errors in my symfony4-project like this:

ERROR: UndefinedInterfaceMethod - src\ControllerShop\IndexController.php:45:68 - Method Doctrine\Common\Persistence\ObjectRepository::createquerybuilder does not exist
$qb = $this->getDoctrine()->getRepository(Article::class)->createQueryBuilder('a');

ERROR: UndefinedInterfaceMethod - src\ControllerShop\IndexController.php:98:83 - Method Doctrine\Common\Persistence\ObjectRepository::findforcompany does not exist
$staffToken = $this->getDoctrine()->getRepository(StaffToken::class)->findForCompany($company, $token);

Problem seems to be, that the methods are not checked against the real repository, but the generic ObjectRepository. Is it right, that the plugin does not recognise these methods in the repositories? Am I doing something wrong here?
Thanks in advance!

@weirdan
Copy link
Member

weirdan commented Jun 7, 2019

What does $this->getDoctrine() return?

@cklm
Copy link
Author

cklm commented Jun 7, 2019

What does $this->getDoctrine() return?

an instance of Doctrine\Common\Persistence\ManagerRegistry

@weirdan weirdan added the blocked label Jun 7, 2019
@weirdan
Copy link
Member

weirdan commented Jun 7, 2019

Ok, the reason you're seeing it now is that getRepository() is declared to return ObjectRepository. DPP (this plugin) would have to figure out there's specific repository for this entity class (thus it depends on #10)

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