You are here

RevisionInfoItemListNormalizer.php in Replication 8

Same filename and directory in other branches
  1. 8.2 src/Normalizer/RevisionInfoItemListNormalizer.php

File

src/Normalizer/RevisionInfoItemListNormalizer.php
View source
<?php

namespace Drupal\replication\Normalizer;

use Drupal\serialization\Normalizer\ListNormalizer;
class RevisionInfoItemListNormalizer extends ListNormalizer {

  /**
   * @var string[]
   */
  protected $supportedInterfaceOrClass = [
    'Drupal\\multiversion\\Plugin\\Field\\FieldType\\RevisionInfoItemList',
  ];

  /**
   * @var string[]
   */
  protected $format = [
    'json',
  ];

  /**
   * {@inheritdoc}
   */
  public function normalize($field, $format = NULL, array $context = []) {
    if (!empty($context['query']['revs_info'])) {
      return parent::normalize($field, $format, $context);
    }
    return [];
  }

}

Classes