zfcampus / zf-doctrine-querybuilder

Doctrine Query Builder request Filters
BSD 3-Clause "New" or "Revised" License
32 stars 19 forks source link

DefaultO*mFactory expects root service manager - BC BREAK #33

Closed TomHAnderson closed 7 years ago

TomHAnderson commented 7 years ago

Not covered in the unit tests is all filters are created through

ZF\Doctrine\QueryBuilder\Filter\Service\O*MFilterManger so this is the ServiceLocator passed to https://github.com/zfcampus/zf-doctrine-querybuilder/blob/master/src/Query/Provider/DefaultOrmFactory.php#L22

The unit tests are written as though there is only the root ServiceLocator/ServiceManger and not considered is all Filters are inside a Zend\ServiceManager\AbstractPluginManager

This is a BC Break and causes the DefaultO*MFactoryies to be useless inside zf-apigility-doctrine.

On the unit tests, a single-level ServiceLocator is created to pass to the Factories: https://github.com/zfcampus/zf-doctrine-querybuilder/blob/master/test/Query/Provider/DefaultOrmFactoryTest.php#L18

And inside the Factories they should either be passed the system ServiceManager or the instance of ZF\Doctrine\QueryBuilder\Filter\Service\O*MFilterManager which would then be queried inside the Factories for the ServiceLocator.

michalbundyra commented 7 years ago

Thanks @TomHAnderson !