{"action":"opened","issue":{"url":"https://api.github.com/repos/TomHAnderson/zf-doctrine-querybuilder/issues/13","labels_url":"https://api.github.com/repos/TomHAnderson/zf-doctrine-querybuilder/issues/13/labels{/name}","comments_url":"https://api.github.com/repos/TomHAnderson/zf-doctrine-querybuilder/issues/13/comments","events_url":"https://api.github.com/repos/TomHAnderson/zf-doctrine-querybuilder/issues/13/events","html_url":"https://github.com/TomHAnderson/zf-doctrine-querybuilder/issues/13","id":97486686,"number":13,"title":"DefaultOdm query providor throws ServiceLocatorUsageException","user":{"login":"lweijl","id":1135396,"avatar_url":"https://avatars.githubusercontent.com/u/1135396?v=3","gravatar_id":"","url":"https://api.github.com/users/lweijl","html_url":"https://github.com/lweijl","followers_url":"https://api.github.com/users/lweijl/followers","following_url":"https://api.github.com/users/lweijl/following{/other_user}","gists_url":"https://api.github.com/users/lweijl/gists{/gist_id}","starred_url":"https://api.github.com/users/lweijl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lweijl/subscriptions","organizations_url":"https://api.github.com/users/lweijl/orgs","repos_url":"https://api.github.com/users/lweijl/repos","events_url":"https://api.github.com/users/lweijl/events{/privacy}","received_events_url":"https://api.github.com/users/lweijl/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-07-27T15:12:41Z","updated_at":"2015-07-27T15:12:41Z","closed_at":null,"body":"Hi there,\r\n\r\nI am trying to integrate MongoDB with Apigility. I configured it using https://packagist.org/packages/doctrine/doctrine-mongo-odm-module and all seemed to be okay. After successfully creating the first doctrine connected rest service with doctrine odm_default, querying seems to be a problem.\r\n\r\nThe DefaultOdm query provider seems to break on the ```createQuery``` function, stating ```Service \\\"Application\\\" has been requested to plugin manager of type \\\"ZF\\\\\\\\Apigility\\\\\\\\Doctrine\\\\\\\\Server\\\\\\\\Query\\\\\\\\Provider\\\\\\\\Service\\\\\\\\QueryProviderManager\\\", but couldn't be retrieved.\\\\\\nA previous exception of type \\\"Zend\\\\\\\\ServiceManager\\\\\\\\Exception\\\\\\\\ServiceNotFoundException\\\" has been raised in the process.\\\\\\nBy the way, a service with the name \\\"Application\\\" has been found in the parent service locator \\\"Zend\\\\\\\\ServiceManager\\\\\\\\ServiceManager\\\": did you forget to use $parentLocator = $serviceLocator->getServiceLocator() in your factory code?```\r\n\r\nChanging the code from\r\n```\r\n    /**\r\n     * {@inheritDoc}\r\n     */\r\n    public function createQuery(ResourceEvent $event, $entityClass, $parameters)\r\n    {\r\n        $request = $this->getServiceLocator()->get('Application')->getRequest()->getQuery()->toArray();\r\n        **snip**\r\n```\r\n\r\nto \r\n```\r\n    /**\r\n     * {@inheritDoc}\r\n     */\r\n    public function createQuery(ResourceEvent $event, $entityClass, $parameters)\r\n    {\r\n        $request = $this->getServiceLocator()->getServiceLocator()->get('Application')->getRequest()->getQuery()->toArray();\r\n        **snip**\r\n```\r\n\r\nseems to fix it, but am curious if this is any wrongdoing on my part or a bug?\r\n\r\nI am not sure what else you need from me, but please let me know what I can do to help.\r\n\r\nRegards,\r\nLennart"}}