Migration::transitionField
Allows you to easily transition data from one field name to the next. Works with generic data objects as well as instances of the SiteTree.
CAUTION: This method is quite abstract, so it could take a very long time to run if you have many objects to transition, especially SiteTree instances. TODO: An issue with SiteTree objects is unpublished instances will not update the currently published version (if one exists).
Signature
public function transitionField(DataObject
$dataObject,
string
$oldFieldName,
string
$newFieldName,
[callable
$transformation = NULL] )
Parameters
$dataObject
— DataObject
$oldFieldName
— string$newFieldName
— string$transformation
— callable