EntityConditionGroupNormalizer.php in JSON:API 8
File
src/Normalizer/EntityConditionGroupNormalizer.php
View source
<?php
namespace Drupal\jsonapi\Normalizer;
use Drupal\jsonapi\Query\EntityConditionGroup;
use Symfony\Component\Serializer\Normalizer\DenormalizerInterface;
class EntityConditionGroupNormalizer implements DenormalizerInterface {
protected $supportedInterfaceOrClass = EntityConditionGroup::class;
protected $formats = [
'api_json',
];
public function supportsDenormalization($data, $type, $format = NULL) {
return $type === $this->supportedInterfaceOrClass;
}
public function denormalize($data, $class, $format = NULL, array $context = []) {
return new EntityConditionGroup($data['conjunction'], $data['members']);
}
}