function Field::query

Same name in this branch
  1. 10 core/modules/field/src/Plugin/migrate/source/d6/Field.php \Drupal\field\Plugin\migrate\source\d6\Field::query()
Same name in other branches
  1. 9 core/modules/field/src/Plugin/migrate/source/d6/Field.php \Drupal\field\Plugin\migrate\source\d6\Field::query()
  2. 9 core/modules/field/src/Plugin/migrate/source/d7/Field.php \Drupal\field\Plugin\migrate\source\d7\Field::query()
  3. 8.9.x core/modules/field/src/Plugin/migrate/source/d6/Field.php \Drupal\field\Plugin\migrate\source\d6\Field::query()
  4. 8.9.x core/modules/field/src/Plugin/migrate/source/d7/Field.php \Drupal\field\Plugin\migrate\source\d7\Field::query()
  5. 11.x core/modules/field/src/Plugin/migrate/source/d6/Field.php \Drupal\field\Plugin\migrate\source\d6\Field::query()
  6. 11.x core/modules/field/src/Plugin/migrate/source/d7/Field.php \Drupal\field\Plugin\migrate\source\d7\Field::query()

Overrides SqlBase::query

1 call to Field::query()
FieldOptionTranslation::query in core/modules/field/src/Plugin/migrate/source/d7/FieldOptionTranslation.php
1 method overrides Field::query()
FieldOptionTranslation::query in core/modules/field/src/Plugin/migrate/source/d7/FieldOptionTranslation.php

File

core/modules/field/src/Plugin/migrate/source/d7/Field.php, line 30

Class

Field
Drupal 7 field source from database.

Namespace

Drupal\field\Plugin\migrate\source\d7

Code

public function query() {
    $query = $this->select('field_config', 'fc')
        ->distinct()
        ->fields('fc')
        ->fields('fci', [
        'entity_type',
    ])
        ->condition('fc.active', 1)
        ->condition('fc.storage_active', 1)
        ->condition('fc.deleted', 0)
        ->condition('fci.deleted', 0);
    $query->join('field_config_instance', 'fci', '[fc].[id] = [fci].[field_id]');
    // The Title module fields are not migrated.
    if ($this->moduleExists('title')) {
        $title_fields = [
            'title_field',
            'name_field',
            'description_field',
            'subject_field',
        ];
        $query->condition('fc.field_name', $title_fields, 'NOT IN');
    }
    return $query;
}

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