Skip to content

Commit

Permalink
HalPagination taken into account
Browse files Browse the repository at this point in the history
  • Loading branch information
Nil Portugués Calderó committed Mar 21, 2017
1 parent 0d6eff6 commit c68a735
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 29 deletions.
58 changes: 30 additions & 28 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 7 additions & 1 deletion src/Serializer/HalJsonSerializer.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
namespace NilPortugues\Symfony\HalJsonBundle\Serializer;

use Exception;
use NilPortugues\Api\Hal\HalPagination;
use NilPortugues\Api\Hal\JsonTransformer;
use NilPortugues\Api\Mapping\Mapping;
use NilPortugues\Serializer\DeepCopySerializer;
Expand Down Expand Up @@ -44,7 +45,12 @@ private function mapUrls(JsonTransformer $transformer, Router $router)
$reflectionProperty->setAccessible(true);
$mappings = $reflectionProperty->getValue($transformer);

foreach ($mappings as &$mapping) {
foreach ($mappings as $key => &$mapping) {

if ($key === HalPagination::class) {
continue;
}

$mappingClass = new ReflectionClass($mapping);

$this->setUrlWithReflection($router, $mapping, $mappingClass, 'resourceUrlPattern');
Expand Down

0 comments on commit c68a735

Please sign in to comment.