public function BlockCustomTranslation::prepareRow in Drupal 8
Same name and namespace in other branches
- 9 core/modules/block_content/src/Plugin/migrate/source/d7/BlockCustomTranslation.php \Drupal\block_content\Plugin\migrate\source\d7\BlockCustomTranslation::prepareRow()
Adds additional data to the row.
Parameters
\Drupal\migrate\Row $row: The row object.
Return value
bool FALSE if this row needs to be skipped.
Overrides SourcePluginBase::prepareRow
File
- core/
modules/ block_content/ src/ Plugin/ migrate/ source/ d7/ BlockCustomTranslation.php, line 58
Class
- BlockCustomTranslation
- Gets Drupal 7 custom block translation from database.
Namespace
Drupal\block_content\Plugin\migrate\source\d7Code
public function prepareRow(Row $row) {
parent::prepareRow($row);
// Set the i18n string table for use in I18nQueryTrait.
$this->i18nStringTable = static::I18N_STRING_TABLE;
// Save the translation for this property.
$property_in_row = $row
->getSourceProperty('property');
// Get the translation for the property not already in the row and save it
// in the row.
$property_not_in_row = $property_in_row === 'title' ? 'body' : 'title';
return $this
->getPropertyNotInRowTranslation($row, $property_not_in_row, 'bid', $this->idMap);
}