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

Breadcrumb

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

function AbstractNormalizerContextBuilder::withGroups

Configures groups containing attributes to (de)normalize.

Eg: ['group1', 'group2']

Parameters

list<string>|string|null $groups:

File

vendor/symfony/serializer/Context/Normalizer/AbstractNormalizerContextBuilder.php, line 64

Class

AbstractNormalizerContextBuilder
A helper providing autocompletion for available AbstractNormalizer options.

Namespace

Symfony\Component\Serializer\Context\Normalizer

Code

public function withGroups(array|string|null $groups) : static {
    if (null === $groups) {
        return $this->with(AbstractNormalizer::GROUPS, null);
    }
    return $this->with(AbstractNormalizer::GROUPS, (array) $groups);
}

API Navigation

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