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

Breadcrumb

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

function JsonEncoderContextBuilder::withAssociative

Configures whether decoded objects will be given as associative arrays or as nested stdClass.

File

vendor/symfony/serializer/Context/Encoder/JsonEncoderContextBuilder.php, line 56

Class

JsonEncoderContextBuilder
A helper providing autocompletion for available JsonEncoder options.

Namespace

Symfony\Component\Serializer\Context\Encoder

Code

public function withAssociative(?bool $associative) : static {
    return $this->with(JsonDecode::ASSOCIATIVE, $associative);
}
RSS feed
Powered by Drupal