Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. BlockCustomTranslation.php

function BlockCustomTranslation::prepareRow

Overrides SourcePluginBase::prepareRow

File

core/modules/block_content/src/Plugin/migrate/source/d7/BlockCustomTranslation.php, line 63

Class

BlockCustomTranslation
Drupal 7 i18n content block translations source from database.

Namespace

Drupal\block_content\Plugin\migrate\source\d7

Code

public function prepareRow(Row $row) {
    if (!parent::prepareRow($row)) {
        return FALSE;
    }
    // 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);
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal