function AbstractNormalizerContextBuilder::withCallbacks
Configures an hashmap of field name => callable to normalize this field.
The callable is called if the field is encountered with the arguments:
- mixed $attributeValue value of this field
- object $object the whole object being normalized
- string $attributeName name of the attribute being normalized
- string $format the requested format
- array<string, mixed> $context the serialization context
Parameters
array<string, callable>|null $callbacks:
File
-
vendor/
symfony/ serializer/ Context/ Normalizer/ AbstractNormalizerContextBuilder.php, line 145
Class
- AbstractNormalizerContextBuilder
- A helper providing autocompletion for available AbstractNormalizer options.
Namespace
Symfony\Component\Serializer\Context\NormalizerCode
public function withCallbacks(?array $callbacks) : static {
return $this->with(AbstractNormalizer::CALLBACKS, $callbacks);
}