Commit eae95a2c authored by Bernhard Schussek's avatar Bernhard Schussek

Made it possible to enable associative array normalization in JsonbSerializedType

parent 6a3db839
......@@ -28,6 +28,11 @@ abstract class JsonbSerializedType extends JsonbType
*/
private static $serializer;
/**
* @var bool
*/
private static $jsonDecodeAssociative = false;
/**
* Sets the factory used to construct the used Serializer instance.
*
......@@ -38,6 +43,11 @@ abstract class JsonbSerializedType extends JsonbType
self::$serializerFactory = $factory;
}
public static function setJsonDecodeAssociative(bool $jsonDecodeAssociative): void
{
self::$jsonDecodeAssociative = $jsonDecodeAssociative;
}
/**
* {@inheritdoc}
*/
......@@ -69,7 +79,7 @@ abstract class JsonbSerializedType extends JsonbType
$value,
$this->getDeserializationType(),
'json',
['json_decode_associative' => false]
['json_decode_associative' => self::$jsonDecodeAssociative]
);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment