public function merge(AttributeMetadataInterface
$attributeMetadata): void
{ foreach ($attributeMetadata->
getGroups() as $group) { $this->
addGroup($group);
} // Overwrite only if not defined
$this->maxDepth ??=
$attributeMetadata->
getMaxDepth();
$this->serializedName ??=
$attributeMetadata->
getSerializedName();
$this->serializedPath ??=
$attributeMetadata->
getSerializedPath();
// Overwrite only if both contexts are empty
if (!
$this->normalizationContexts && !
$this->denormalizationContexts
) { $this->normalizationContexts =
$attributeMetadata->
getNormalizationContexts();
$this->denormalizationContexts =
$attributeMetadata->
getDenormalizationContexts();
} if ($ignore =
$attributeMetadata->
isIgnored()) { $this->ignore =
$ignore;
} }