From a08d8368da8f850e0447f467d1b2d0211a4eb179 Mon Sep 17 00:00:00 2001 From: Mat Wright Date: Sun, 3 Jul 2016 12:41:25 +0200 Subject: [PATCH] inject service locator into DoctrineAutodiscoveryModel DoctrineAutodiscoveryModel extends AbstractAutodiscoveryModel which is dependent on the root service locator for the moduleHasService call therefore that must be injected into any class extending this abstract. --- src/Admin/Module.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Admin/Module.php b/src/Admin/Module.php index c4cde452..9e0fe429 100644 --- a/src/Admin/Module.php +++ b/src/Admin/Module.php @@ -68,8 +68,9 @@ public function getServiceConfig() // @codeCoverageIgnoreEnd } $config = $services->get('Config'); - - return new Model\DoctrineAutodiscoveryModel($config); + $model= new Model\DoctrineAutodiscoveryModel($config); + $model->setServiceLocator($services); + return $model; }, 'ZF\Apigility\Doctrine\Admin\Model\DoctrineRestServiceModelFactory' => function ($services) { if (!$services->has('ZF\Apigility\Admin\Model\ModulePathSpec')