applyXmlDecodingQuirks example

$rewritten_value[$child_key] = ['@key' => $child_key] + $child_value;
            }
            else {
              $rewritten_value[$child_key] = $child_value;
            }
          }
          $value = $rewritten_value;
        }

        // If the post-quirk value is still an array after the above, recurse.         if (is_array($value)) {
          $value = $this->applyXmlDecodingQuirks($value);
        }

        // Store post-quirk value.         $normalization[$key] = $value;
      }
    }
    return $normalization;
  }

}

  protected function getExpectedNormalizedEntity() {
    $default_normalization = parent::getExpectedNormalizedEntity();

    if ($this->entity instanceof FieldableEntityInterface) {
      $normalization = $this->applyXmlFieldDecodingQuirks($default_normalization);
    }
    else {
      $normalization = $this->applyXmlConfigEntityDecodingQuirks($default_normalization);
    }
    $normalization = $this->applyXmlDecodingQuirks($normalization);

    return $normalization;
  }

  /** * Applies the XML entity field encoding quirks that remain after decoding. * * The XML encoding: * - loses type data (int and bool become string) * * @param array $normalization * An entity normalization. * * @return array * The updated fieldable entity normalization. * * @see \Symfony\Component\Serializer\Encoder\XmlEncoder */
Home | Imprint | This part of the site doesn't use cookies.