function DummyQueryTrait::query

Same name in other branches
  1. 9 core/modules/migrate/src/Plugin/migrate/source/DummyQueryTrait.php \Drupal\migrate\Plugin\migrate\source\DummyQueryTrait::query()
  2. 8.9.x core/modules/migrate/src/Plugin/migrate/source/DummyQueryTrait.php \Drupal\migrate\Plugin\migrate\source\DummyQueryTrait::query()
  3. 11.x core/modules/migrate/src/Plugin/migrate/source/DummyQueryTrait.php \Drupal\migrate\Plugin\migrate\source\DummyQueryTrait::query()

File

core/modules/migrate/src/Plugin/migrate/source/DummyQueryTrait.php, line 18

Class

DummyQueryTrait
Provides a dummy select query object for source plugins.

Namespace

Drupal\migrate\Plugin\migrate\source

Code

public function query() {
    // Pass an arbitrary table name - the query should never be executed
    // anyway.
    $query = $this->select(uniqid(), 's')
        ->range(0, 1);
    $query->addExpression('1');
    return $query;
}

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