3 namespace Drupal\block\Plugin\migrate\source\d7;
5 use Drupal\block\Plugin\migrate\source\Block;
8 * Gets i18n block data from source database.
11 * id = "d7_block_translation",
12 * source_module = "i18n_block"
15 class BlockTranslation extends Block {
20 public function query() {
21 // Let the parent set the block table to use, but do not use the parent
22 // query. Instead build a query so can use an inner join to the selected
25 $query = $this->select('i18n_string', 'i18n')
50 ->condition('i18n_mode', 1);
51 $query->leftjoin($this->blockTable, 'b', ('b.delta = i18n.objectid'));
52 $query->leftjoin('locales_target', 'lt', 'lt.lid = i18n.lid');
59 public function fields() {
61 'bid' => $this->t('The block numeric identifier.'),
62 'module' => $this->t('The module providing the block.'),
63 'delta' => $this->t("The block's delta."),
64 'theme' => $this->t('Which theme the block is placed in.'),
65 'status' => $this->t('Block enabled status'),
66 'weight' => $this->t('Block weight within region'),
67 'region' => $this->t('Theme region within which the block is set'),
68 'visibility' => $this->t('Visibility'),
69 'pages' => $this->t('Pages list.'),
70 'title' => $this->t('Block title.'),
71 'cache' => $this->t('Cache rule.'),
72 'i18n_mode' => $this->t('Multilingual mode'),
73 'lid' => $this->t('Language string ID'),
74 'textgroup' => $this->t('A module defined group of translations'),
75 'context' => $this->t('Full string ID for quick search: type:objectid:property.'),
76 'objectid' => $this->t('Object ID'),
77 'type' => $this->t('Object type for this string'),
78 'property' => $this->t('Object property for this string'),
79 'objectindex' => $this->t('Integer value of Object ID'),
80 'format' => $this->t('The {filter_format}.format of the string'),
81 'translation' => $this->t('Translation'),
82 'language' => $this->t('Language code'),
83 'plid' => $this->t('Parent lid'),
84 'plural' => $this->t('Plural index number'),
85 'i18n_status' => $this->t('Translation needs update'),
92 public function getIds() {
93 $ids['delta']['type'] = 'string';
94 $ids['delta']['alias'] = 'b';
95 $ids['language']['type'] = 'string';