RevisionInfoItemListNormalizer.php in Replication 8
File
src/Normalizer/RevisionInfoItemListNormalizer.php
View source
<?php
namespace Drupal\replication\Normalizer;
use Drupal\serialization\Normalizer\ListNormalizer;
class RevisionInfoItemListNormalizer extends ListNormalizer {
protected $supportedInterfaceOrClass = [
'Drupal\\multiversion\\Plugin\\Field\\FieldType\\RevisionInfoItemList',
];
protected $format = [
'json',
];
public function normalize($field, $format = NULL, array $context = []) {
if (!empty($context['query']['revs_info'])) {
return parent::normalize($field, $format, $context);
}
return [];
}
}