Skip to content

Commit

Permalink
Merge branch 'Seblours/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
sanpii committed Feb 26, 2016
2 parents 691df46 + 023dc68 commit 5ad7902
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 1 deletion.
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"require": {
"pomm-project/foundation": "~2.0",
"symfony/http-foundation": "~2.5|~3.0",
"symfony/http-kernel": "~2.5|~3.0"
"symfony/http-kernel": "~2.5|~3.0",
"symfony/serializer": "~2.5|~3.0"
},
"suggest": {
"pomm-project/model-manager": "~2.0",
Expand Down
32 changes: 32 additions & 0 deletions sources/lib/Serializer/Normalizer/FlexibleEntityNormalizer.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?php
/*
* This file is part of Pomm's SymfonyBidge package.
*
* (c) 2014 Grégoire HUBERT <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PommProject\SymfonyBridge\Serializer\Normalizer;

use PommProject\ModelManager\Model\FlexibleEntity\FlexibleEntityInterface;
use Symfony\Component\Serializer\Normalizer\NormalizerInterface;

class FlexibleEntityNormalizer implements NormalizerInterface
{
/**
* {@inheritdoc}
*/
public function normalize($object, $format = null, array $context = array())
{
return $object->extract();
}

/**
* {@inheritdoc}
*/
public function supportsNormalization($data, $format = null)
{
return $data instanceof FlexibleEntityInterface;
}
}

0 comments on commit 5ad7902

Please sign in to comment.