You are here

public function FieldNormalizer::supportsNormalization in Commerce Cart API 8

Overrides NormalizerBase::supportsNormalization

File

src/Normalizer/FieldNormalizer.php, line 34

Class

FieldNormalizer
Field 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;
}