processing of review. still ACL left to do

This commit is contained in:
2021-10-29 11:30:01 +02:00
parent e1d28289f6
commit 50fbc7fd15
6 changed files with 110 additions and 89 deletions

View File

@@ -1,38 +0,0 @@
<?php
declare(strict_types=1);
namespace Chill\PersonBundle\Serializer\Normalizer;
use Chill\PersonBundle\Entity\Relationships\Relationship;
use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait;
use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface;
use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait;
use Symfony\Component\Serializer\Normalizer\NormalizerInterface;
use Symfony\Component\Serializer\Normalizer\ObjectToPopulateTrait;
class RelationshipNormalizer implements NormalizerInterface, NormalizerAwareInterface
{
use NormalizerAwareTrait;
use ObjectToPopulateTrait;
use DenormalizerAwareTrait;
public function normalize($relationship, ?string $format = null, array $context = [])
{
return [
'type' => 'relationship',
'id' => $this->normalizer->normalize($relationship->getId()),
'fromPerson' => $this->normalizer->normalize($relationship->getFromPerson()),
'toPerson' => $this->normalizer->normalize($relationship->getToPerson()),
'relation' => $this->normalizer->normalize($relationship->getRelation()),
'reverse' => $relationship->getReverse()
];
}
public function supportsNormalization($data, ?string $format = null)
{
return $data instanceof Relationship;
}
}