FieldInstanceOptionTranslation.php

Same filename in this branch
  1. 11.x core/modules/field/src/Plugin/migrate/process/d6/FieldInstanceOptionTranslation.php
  2. 11.x core/modules/field/src/Plugin/migrate/process/d7/FieldInstanceOptionTranslation.php
Same filename in other branches
  1. 9 core/modules/field/src/Plugin/migrate/source/d6/FieldInstanceOptionTranslation.php
  2. 9 core/modules/field/src/Plugin/migrate/process/d6/FieldInstanceOptionTranslation.php
  3. 9 core/modules/field/src/Plugin/migrate/process/d7/FieldInstanceOptionTranslation.php
  4. 8.9.x core/modules/field/src/Plugin/migrate/source/d6/FieldInstanceOptionTranslation.php
  5. 8.9.x core/modules/field/src/Plugin/migrate/process/d6/FieldInstanceOptionTranslation.php
  6. 8.9.x core/modules/field/src/Plugin/migrate/process/d7/FieldInstanceOptionTranslation.php
  7. 10 core/modules/field/src/Plugin/migrate/source/d6/FieldInstanceOptionTranslation.php
  8. 10 core/modules/field/src/Plugin/migrate/process/d6/FieldInstanceOptionTranslation.php
  9. 10 core/modules/field/src/Plugin/migrate/process/d7/FieldInstanceOptionTranslation.php

Namespace

Drupal\field\Plugin\migrate\source\d6

File

core/modules/field/src/Plugin/migrate/source/d6/FieldInstanceOptionTranslation.php

View source
<?php

namespace Drupal\field\Plugin\migrate\source\d6;

// cspell:ignore cnfi

/**
 * Drupal 6 i18n field instance option labels source from database.
 *
 * For available configuration keys, refer to the parent classes.
 *
 * @see \Drupal\migrate\Plugin\migrate\source\SqlBase
 * @see \Drupal\migrate\Plugin\migrate\source\SourcePluginBase
 *
 * @MigrateSource(
 *   id = "d6_field_instance_option_translation",
 *   source_module = "i18ncck"
 * )
 */
class FieldInstanceOptionTranslation extends FieldOptionTranslation {
    
    /**
     * {@inheritdoc}
     */
    public function query() {
        $query = parent::query();
        $query->join('content_node_field_instance', 'cnfi', '[cnfi].[field_name] = [cnf].[field_name]');
        $query->addField('cnfi', 'type_name');
        return $query;
    }
    
    /**
     * {@inheritdoc}
     */
    public function fields() {
        $fields = [
            'type_name' => $this->t('Type (article, page, ....)'),
        ];
        return parent::fields() + $fields;
    }

}

Classes

Title Deprecated Summary
FieldInstanceOptionTranslation Drupal 6 i18n field instance option labels source from database.

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.