When a new entity is added to a collection set using the MutableSetFieldModel::addValue() method, any existing matching entity in the set gets replaced. Add a mergeValue() method that merges the new entity fields into the existing match entity in the set. If the same field exists in both, the new entity's fields take precedence. If there is no matching entity, then the new entity gets added to the set. The method should return true if there was a matching entity, else it should return false.
When a new entity is added to a collection set using the
MutableSetFieldModel::addValue()
method, any existing matching entity in the set gets replaced. Add amergeValue()
method that merges the new entity fields into the existing match entity in the set. If the same field exists in both, the new entity's fields take precedence. If there is no matching entity, then the new entity gets added to the set. The method should returntrue
if there was a matching entity, else it should returnfalse
.