Skip to content
This repository has been archived by the owner on Jan 21, 2020. It is now read-only.

Commit

Permalink
Merge pull request #257 from TomHAnderson/hotfix/253-collection-link
Browse files Browse the repository at this point in the history
Hotfix/253 collection link
  • Loading branch information
TomHAnderson authored Jun 12, 2016
2 parents fa00dbe + 86369c0 commit 144cdeb
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 52 deletions.
4 changes: 3 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
17 changes: 0 additions & 17 deletions src/Admin/Model/DoctrineRestServiceModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
33 changes: 0 additions & 33 deletions src/Server/Hydrator/Strategy/CollectionExtract.php

This file was deleted.

1 change: 0 additions & 1 deletion src/Server/Resource/DoctrineResourceFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ class DoctrineResourceFactory implements AbstractFactoryInterface
public function canCreateServiceWithName(ServiceLocatorInterface $serviceLocator, $name, $requestedName)
{
if (array_key_exists($requestedName, $this->lookupCache)) {

return $this->lookupCache[$requestedName];
}

Expand Down

0 comments on commit 144cdeb

Please sign in to comment.