You are here

public function FieldItemNormalizer::supportsNormalization in Commerce Cart API 8

Overrides NormalizerBase::supportsNormalization

File

src/Normalizer/FieldItemNormalizer.php, line 39

Class

FieldItemNormalizer
Field item normalizer which flattens output.

Namespace

Drupal\commerce_cart_api\Normalizer

Code

public function supportsNormalization($data, $format = NULL) {
  $supported = parent::supportsNormalization($data, $format);
  if ($supported) {
    $route = $this->routeMatch
      ->getRouteObject();
    return $route && $route
      ->hasRequirement('_cart_api');
  }
  return $supported;
}