public function LanguageContentSettingsTaxonomyVocabulary::prepareRow in Drupal 9
Same name and namespace in other branches
- 8 core/modules/language/src/Plugin/migrate/source/d6/LanguageContentSettingsTaxonomyVocabulary.php \Drupal\language\Plugin\migrate\source\d6\LanguageContentSettingsTaxonomyVocabulary::prepareRow()
- 10 core/modules/language/src/Plugin/migrate/source/d6/LanguageContentSettingsTaxonomyVocabulary.php \Drupal\language\Plugin\migrate\source\d6\LanguageContentSettingsTaxonomyVocabulary::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/ language/ src/ Plugin/ migrate/ source/ d6/ LanguageContentSettingsTaxonomyVocabulary.php, line 50
Class
- LanguageContentSettingsTaxonomyVocabulary
- Drupal 6 i18n vocabularies source from database.
Namespace
Drupal\language\Plugin\migrate\source\d6Code
public function prepareRow(Row $row) {
// Get the i18n taxonomy translation setting for this vocabulary.
// 0 - No multilingual options
// 1 - Localizable terms. Run through the localization system.
// 2 - Predefined language for a vocabulary and its terms.
// 3 - Per-language terms, translatable (referencing terms with different
// languages) but not localizable.
$i18ntaxonomy_vocabulary = $this
->variableGet('i18ntaxonomy_vocabulary', []);
$vid = $row
->getSourceProperty('vid');
$state = 0;
if (array_key_exists($vid, $i18ntaxonomy_vocabulary)) {
$state = $i18ntaxonomy_vocabulary[$vid];
}
$row
->setSourceProperty('state', $state);
return parent::prepareRow($row);
}