WriteParameterBag
$parameters ): \Generator
{ if (!
$field instanceof JsonField
) { throw DataAbstractionLayerException::
invalidSerializerField(JsonField::
class,
$field);
} $this->
validateIfNeeded($field,
$existence,
$data,
$parameters);
$value =
$data->
getValue() ??
$field->
getDefault();
if ($value !== null && !
empty($field->
getPropertyMapping())) { $value =
$this->
validateMapping($field,
$value,
$parameters);
} if ($value !== null
) { $value = Json::
encode($value);
} yield $field->
getStorageName() =>
$value;
} public function decode(Field
$field, mixed
$value): mixed
{