public function prepareRow(Row $row) {
$name = $row
->getSourceProperty('field_name');
// Remove field_ prefix for new bundle.
$bundle = substr($name, FieldCollection::FIELD_COLLECTION_PREFIX_LENGTH);
$row
->setSourceProperty('bundle', $bundle);
// Field collections don't have descriptions, optionally add one.
if ($this->configuration['add_description']) {
$row
->setSourceProperty('description', 'Migrated from field_collection ' . $name);
}
else {
$row
->setSourceProperty('description', '');
}
// Set label from bundle because we don't have a label in D7 field
// collections.
$row
->setSourceProperty('name', ucfirst(preg_replace('/_/', ' ', $bundle)));
return parent::prepareRow($row);
}