Add callback to existing migrate field mapping I have a use case where I want to use the callbacks functionality for the body field in a D6->D7 migration using migrate and migrate_d2d modules. However, according to the above-referenced docs page, this is done when you are adding a new field mapping:

$this-&gt;addFieldMapping('destination_field', 'source_field')-&gt;callbacks('my_callback');


not adding to an existing mapping. How can I add a callback to an existing mapping? Do I have to remove and then re-add the mapping, or is there another way?
With some debugging and looking at code, it turned out to be pretty easy. All of the mappings are MigrateFieldMapping objects in $this->codedFieldMappings, so it's just a matter of getting a reference to that object and calling the callbacks() method. For example, to add a callback to the body field, you would use:

$this-&gt;codedFieldMappings['body']-&gt;callbacks('my_callback');