Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork142
Allow custom getRepository()-like methods#1276
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:master
Are you sure you want to change the base?
Uh oh!
There was an error while loading.Please reload this page.
Conversation
theredled commentedJan 20, 2019 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
I'm only wondering about that part in Maybe removing that commented line as I did is too permissive and can cause performance issues? If so, we could narrow the matching methods to "get*" for example... |
Haehnchen commentedJan 21, 2019
@theredled yes this mentioned method check is for performance and also to not overflow the phpstorm signatures for every method. By removing this simply we are saying we are responsible for all methods. We need some filtering here. But for now i just see to support it via a configuration. Another way would be by using the "php7 returns" and index every file to get "getRepo" automaticcally. But as the index is build inside "getType" we dont have access to it at this point. So this must then be cached. So would be a bigger task. |
Uh oh!
There was an error while loading.Please reload this page.
getRepository() currently only support direct calls to
ManagerRegistry::getRepositoryorObjectManager::getRepository.This PR supports other methods - typically shortcuts in Controllers - as soon as they use
ObjectRepositoryor a child class as a PHP code return type.Note : seems hard to support PHPDoc.
Example :