Closed TomHAnderson closed 9 years ago
@renooo does this fix the issue you were having? This module did fall behind zf-apigility-doctrine Query Providers and there are still no tests for the providers included here.
I tried with your code for ZF\Doctrine\QueryBuilder\Query\Provider\DefaultOrm and it doesn't work.
PHP Catchable fatal error: Argument 1 passed to ZF\Apigility\Doctrine\Server\Query\Provider\DefaultOrm::createQuery() must be an instance of ZF\Rest\ResourceEvent, none given, called in [...]/vendor/zfcampus/zf-doctrine-querybuilder/src/Query/Provider/DefaultOrm.php on line 51 and defined in [...]/vendor/zfcampus/zf-apigility-doctrine/src/Server/Query/Provider/DefaultOrm.php on line 23
But it works with https://github.com/zfcampus/zf-doctrine-querybuilder/pull/6
I'll try to write somme tests soon.
I didn't pass params to the parent::createQuery Give this one a try please.
It fails with :
PHP Fatal error: Cannot use object of type ZF\ContentNegotiation\Request as array in [...]/vendor/zfcampus/zf-doctrine-querybuilder/src/Query/Provider/DefaultOrm.php on line 58
Thanks for the patience. I wasn't extracting the getQuery()->toArray() from the request. I think this'll fix it.
ZF\\Apigility\\Doctrine\\Server\\Query\\Provider\\Service\\QueryProviderManager::get was unable to fetch or create an instance for ZfDoctrineQueryBuilderFilterManagerOrm
Because you have a dedicated Manager in this context, a kind of "sub-ServiceLocator", this is not enough :
$filterManager = $this->getServiceLocator()->get('ZfDoctrineQueryBuilderFilterManagerOrm');
You need to do :
$filterManager = $this->getServiceLocator()->getServiceLocator()->get('ZfDoctrineQueryBuilderFilterManagerOrm');
Actually :
$filterManager = $this->getServiceLocator()
->getServiceLocator()
->get('ZfDoctrineQueryBuilderFilterManagerOrm');
and :
$orderByManager = $this->getServiceLocator()
->getServiceLocator()
->get('ZfDoctrineQueryBuilderOrderByManagerOrm');
I added these as a convenience and I hope they start becoming so after this fix.
It works like a charm both for filter and orderBy. Thank you very much !
Hello, When it will be merge to master branch? After updating zf-apigility-doctrine to latest stable version I got this error:
PHP Fatal error: Call to undefined method ZF\Doctrine\QueryBuilder\Query\Provider\DefaultOrm::setOAuth2Server() in /var/www/frontend/shared/vendor/zfcampus/zf-apigility-doctrine/src/Server/Resource/DoctrineResourceFactory.php on line 276
If use develop branch zf-doctrine-querybuilder this works fine.
The query providers had not been updated to extend from the base query providers of zf-apigility-doctrine.
This is in reply to https://github.com/zfcampus/zf-doctrine-querybuilder/pull/6