You are here

public function MenuLinkContentNormalizer::supportsDenormalization in Replication 8

Implements \Symfony\Component\Serializer\Normalizer\DenormalizerInterface::supportsDenormalization()

This class doesn't implement DenormalizerInterface, but most of its child classes do. Therefore, this method is implemented at this level to reduce code duplication.

Overrides NormalizerBase::supportsDenormalization

File

src/Normalizer/MenuLinkContentNormalizer.php, line 72

Class

MenuLinkContentNormalizer

Namespace

Drupal\replication\Normalizer

Code

public function supportsDenormalization($data, $type, $format = NULL) {
  if (in_array($type, [
    'Drupal\\menu_link_content\\MenuLinkContentInterface',
    'Drupal\\Core\\Entity\\ContentEntityInterface',
  ], true)) {
    if (isset($data['@type']) && $data['@type'] == 'menu_link_content') {
      return TRUE;
    }
  }
  return FALSE;
}