diff --git a/composer.json b/composer.json index 3b2c7825..dc7262df 100644 --- a/composer.json +++ b/composer.json @@ -42,7 +42,9 @@ }, "suggest": { "doctrine/doctrine-orm-module": "For ORM mapping", - "doctrine/doctrine-mongo-odm-module": "For Mongo ODM mapping" + "doctrine/doctrine-mongo-odm-module": "For Mongo ODM mapping", + "api-skeletons/zf-doctrine-hydrator": "Hydrator strategies for Doctrine in Apipgility", + "api-skeletons/zf-oauth2-doctrine": "OAuth2 Doctrine Adapter for Apigility" }, "prefer-stable": true, "autoload": { diff --git a/src/Admin/Model/DoctrineRestServiceModel.php b/src/Admin/Model/DoctrineRestServiceModel.php index 2acee4bf..ac35776e 100644 --- a/src/Admin/Model/DoctrineRestServiceModel.php +++ b/src/Admin/Model/DoctrineRestServiceModel.php @@ -768,23 +768,6 @@ public function createDoctrineConfig(DoctrineRestServiceEntity $details, $entity $objectManager = $this->getServiceManager()->get($details->objectManager); $hydratorStrategies = array(); - // Add all ORM collections to Hydrator Strategies - if ($objectManager instanceof \Doctrine\ORM\EntityManager) { - $collectionStrategyName = 'ZF\Apigility\Doctrine\Server\Hydrator\Strategy\CollectionLink'; - $metadataFactory = $objectManager->getMetadataFactory(); - $metadata = $metadataFactory->getMetadataFor($entityClass); - - foreach ($metadata->associationMappings as $relationName => $relationMapping) { - switch ($relationMapping['type']) { - case 4: - $hydratorStrategies[$relationName] = $collectionStrategyName; - break; - default: - break; - } - } - } - // The abstract_factories key is set to the value so these factories do not get duplicaed with each resource $config = array( 'zf-apigility' => array( diff --git a/src/Server/Hydrator/Strategy/CollectionExtract.php b/src/Server/Hydrator/Strategy/CollectionExtract.php deleted file mode 100644 index b8980dd5..00000000 --- a/src/Server/Hydrator/Strategy/CollectionExtract.php +++ /dev/null @@ -1,33 +0,0 @@ -lookupCache)) { - return $this->lookupCache[$requestedName]; }