You are here

public function Field::query in Drupal 9

Same name in this branch
  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()
Same name and namespace in other branches
  1. 8 core/modules/field/src/Plugin/migrate/source/d6/Field.php \Drupal\field\Plugin\migrate\source\d6\Field::query()

Return value

\Drupal\Core\Database\Query\SelectInterface

Overrides SqlBase::query

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

File

core/modules/field/src/Plugin/migrate/source/d6/Field.php, line 25

Class

Field
Drupal 6 field source from database.

Namespace

Drupal\field\Plugin\migrate\source\d6

Code

public function query() {
  $query = $this
    ->select('content_node_field', 'cnf')
    ->fields('cnf', [
    'field_name',
    'type',
    'global_settings',
    'required',
    'multiple',
    'db_storage',
    'module',
    'db_columns',
    'active',
    'locked',
  ])
    ->distinct();

  // Only import fields which are actually being used.
  $query
    ->innerJoin('content_node_field_instance', 'cnfi', '[cnfi].[field_name] = [cnf].[field_name]');
  return $query;
}