You are here

class RevisionInfoItemListNormalizer in Replication 8

Same name and namespace in other branches
  1. 8.2 src/Normalizer/RevisionInfoItemListNormalizer.php \Drupal\replication\Normalizer\RevisionInfoItemListNormalizer

Hierarchy

Expanded class hierarchy of RevisionInfoItemListNormalizer

1 string reference to 'RevisionInfoItemListNormalizer'
replication.services.yml in ./replication.services.yml
replication.services.yml
1 service uses RevisionInfoItemListNormalizer
replication.normalizer.revision_info_item_list in ./replication.services.yml
Drupal\replication\Normalizer\RevisionInfoItemListNormalizer

File

src/Normalizer/RevisionInfoItemListNormalizer.php, line 7

Namespace

Drupal\replication\Normalizer
View source
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 [];
  }

}

Members

Namesort descending Modifiers Type Description Overrides
CacheableNormalizerInterface::SERIALIZATION_CONTEXT_CACHEABILITY constant Name of key for bubbling cacheability metadata via serialization context.
NormalizerBase::addCacheableDependency protected function Adds cacheability if applicable.
NormalizerBase::checkFormat protected function Checks if the provided format is supported by this normalizer. 2
NormalizerBase::supportsDenormalization public function Implements \Symfony\Component\Serializer\Normalizer\DenormalizerInterface::supportsDenormalization() 1
NormalizerBase::supportsNormalization public function Checks whether the given class is supported for normalization by this normalizer. 1
RevisionInfoItemListNormalizer::$format protected property Overrides NormalizerBase::$format
RevisionInfoItemListNormalizer::$supportedInterfaceOrClass protected property Overrides ListNormalizer::$supportedInterfaceOrClass
RevisionInfoItemListNormalizer::normalize public function Normalizes an object into a set of arrays/scalars. Overrides ListNormalizer::normalize