You are here

DeletedFlagItemListNormalizer.php in Replication 8.2

Same filename and directory in other branches
  1. 8 src/Normalizer/DeletedFlagItemListNormalizer.php

File

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

namespace Drupal\replication\Normalizer;

use Drupal\serialization\Normalizer\NormalizerBase;
use Symfony\Component\Serializer\Normalizer\DenormalizerInterface;
class DeletedFlagItemListNormalizer extends NormalizerBase implements DenormalizerInterface {

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

  /**
   * {@inheritdoc}
   */
  public function normalize($field, $format = NULL, array $context = []) {
    return $field->value;
  }

  /**
   * {@inheritdoc}
   */
  public function denormalize($data, $class, $format = NULL, array $context = []) {
    return [
      [
        'value' => $data,
      ],
    ];
  }

}

Classes