/**
  * {@inheritdoc}
  */
 public function normalize($attribute, $format = null, array $context = [])
 {
     $dateMin = null === $attribute->getDateMin() ? '' : $attribute->getDateMin()->format(\DateTime::ISO8601);
     $dateMax = null === $attribute->getDateMax() ? '' : $attribute->getDateMax()->format(\DateTime::ISO8601);
     $normalizedAttribute = $this->normalizer->normalize($attribute, 'json', $context) + ['id' => $attribute->getId(), 'wysiwyg_enabled' => $attribute->isWysiwygEnabled(), 'empty_value' => $this->emptyValueProvider->getEmptyValue($attribute), 'field_type' => $this->fieldProvider->getField($attribute), 'is_locale_specific' => (int) $attribute->isLocaleSpecific(), 'locale_specific_codes' => $attribute->getLocaleSpecificCodes(), 'max_characters' => $attribute->getMaxCharacters(), 'validation_rule' => $attribute->getValidationRule(), 'validation_regexp' => $attribute->getValidationRegexp(), 'number_min' => $attribute->getNumberMin(), 'number_max' => $attribute->getNumberMax(), 'decimals_allowed' => $attribute->isDecimalsAllowed(), 'negative_allowed' => $attribute->isNegativeAllowed(), 'date_min' => $dateMin, 'date_max' => $dateMax, 'metric_family' => $attribute->getMetricFamily(), 'default_metric_unit' => $attribute->getDefaultMetricUnit(), 'max_file_size' => $attribute->getMaxFileSize(), 'sort_order' => $attribute->getSortOrder()];
     return $normalizedAttribute;
 }
 /**
  * {@inheritdoc}
  */
 public function normalize($attribute, $format = null, array $context = [])
 {
     $dateMin = null === $attribute->getDateMin() ? '' : $attribute->getDateMin()->format(\DateTime::ISO8601);
     $dateMax = null === $attribute->getDateMax() ? '' : $attribute->getDateMax()->format(\DateTime::ISO8601);
     $groupCode = null === $attribute->getGroup() ? null : $attribute->getGroup()->getCode();
     $normalizedAttribute = $this->normalizer->normalize($attribute, 'json', $context) + ['id' => $attribute->getId(), 'wysiwyg_enabled' => $attribute->isWysiwygEnabled(), 'empty_value' => $this->emptyValueProvider->getEmptyValue($attribute), 'field_type' => $this->fieldProvider->getField($attribute), 'filter_types' => $this->filterProvider->getFilters($attribute), 'is_locale_specific' => (int) $attribute->isLocaleSpecific(), 'locale_specific_codes' => $attribute->getLocaleSpecificCodes(), 'max_characters' => $attribute->getMaxCharacters(), 'validation_rule' => $attribute->getValidationRule(), 'validation_regexp' => $attribute->getValidationRegexp(), 'number_min' => $attribute->getNumberMin(), 'number_max' => $attribute->getNumberMax(), 'decimals_allowed' => $attribute->isDecimalsAllowed(), 'negative_allowed' => $attribute->isNegativeAllowed(), 'date_min' => $dateMin, 'date_max' => $dateMax, 'metric_family' => $attribute->getMetricFamily(), 'default_metric_unit' => $attribute->getDefaultMetricUnit(), 'max_file_size' => $attribute->getMaxFileSize(), 'sort_order' => $attribute->getSortOrder(), 'group_code' => $groupCode];
     // This normalizer is used in the PEF attributes loading and in the add_attributes widget. The attributes
     // loading does not need complete group normalization. This has to be cleaned.
     $normalizedAttribute['group'] = null;
     if (isset($context['include_group']) && $context['include_group'] && null !== $attribute->getGroup()) {
         $normalizedAttribute['group'] = $this->normalizer->normalize($attribute->getGroup(), 'json', $context);
     }
     return $normalizedAttribute;
 }
 /**
  * {@inheritdoc}
  */
 public function normalize($attribute, $format = null, array $context = [])
 {
     $normalizedAttribute = $this->normalizer->normalize($attribute, 'json', $context) + ['id' => $attribute->getId(), 'wysiwyg_enabled' => $attribute->isWysiwygEnabled(), 'empty_value' => $this->emptyValueProvider->getEmptyValue($attribute), 'field_type' => $this->fieldProvider->getField($attribute), 'is_locale_specific' => (int) $attribute->isLocaleSpecific(), 'locale_specific_codes' => $attribute->getLocaleSpecificCodes()];
     return $normalizedAttribute;
 }
 /**
  * {@inheritdoc}
  */
 public function normalize($attribute, $format = null, array $context = [])
 {
     $normalizedAttribute = $this->normalizer->normalize($attribute, 'json', $context) + ['id' => $attribute->getId(), 'wysiwyg_enabled' => $attribute->isWysiwygEnabled(), 'empty_value' => $this->emptyValueProvider->getEmptyValue($attribute), 'field_type' => $this->fieldProvider->getField($attribute)];
     return $normalizedAttribute;
 }