Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. AbstractObjectNormalizerContextBuilder.php

function AbstractObjectNormalizerContextBuilder::withPreserveEmptyObjects

Configures whether an empty object should be kept as an object (in JSON: {}) or converted to a list (in JSON: []).

File

vendor/symfony/serializer/Context/Normalizer/AbstractObjectNormalizerContextBuilder.php, line 127

Class

AbstractObjectNormalizerContextBuilder
A helper providing autocompletion for available AbstractObjectNormalizer options.

Namespace

Symfony\Component\Serializer\Context\Normalizer

Code

public function withPreserveEmptyObjects(?bool $preserveEmptyObjects) : static {
    return $this->with(AbstractObjectNormalizer::PRESERVE_EMPTY_OBJECTS, $preserveEmptyObjects);
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal