You are here

public function WebformEntityReferenceItemNormalizer::normalize in Replication 8

Overrides EntityReferenceItemNormalizer::normalize

File

src/Normalizer/WebformEntityReferenceItemNormalizer.php, line 22

Class

WebformEntityReferenceItemNormalizer
Defines a class for normalizing WebformEntityReferenceItems.

Namespace

Drupal\replication\Normalizer

Code

public function normalize($field, $format = NULL, array $context = []) {
  $value = parent::normalize($field, $format, $context);
  if (isset($value['open']) && empty($value['open'])) {
    unset($value['open']);
  }
  if (isset($value['close']) && empty($value['close'])) {
    unset($value['close']);
  }
  return $value;
}