public function BeerTerm::query in Migrate Plus 8.5
Same name and namespace in other branches
- 8 migrate_example/src/Plugin/migrate/source/BeerTerm.php \Drupal\migrate_example\Plugin\migrate\source\BeerTerm::query()
- 8.2 migrate_example/src/Plugin/migrate/source/BeerTerm.php \Drupal\migrate_example\Plugin\migrate\source\BeerTerm::query()
- 8.3 migrate_example/src/Plugin/migrate/source/BeerTerm.php \Drupal\migrate_example\Plugin\migrate\source\BeerTerm::query()
- 8.4 migrate_example/src/Plugin/migrate/source/BeerTerm.php \Drupal\migrate_example\Plugin\migrate\source\BeerTerm::query()
Return value
\Drupal\Core\Database\Query\SelectInterface
Overrides SqlBase::query
File
- migrate_example/
src/ Plugin/ migrate/ source/ BeerTerm.php, line 28
Class
- BeerTerm
- This is an example of a simple SQL-based source plugin.
Namespace
Drupal\migrate_example\Plugin\migrate\sourceCode
public function query() {
// The most important part of a SQL source plugin is the SQL query to
// retrieve the data to be imported. Note that the query is not executed
// here - the migration process will control execution of the query. Also
// note that it is constructed from a $this->select() call - this ensures
// that the query is executed against the database configured for this
// source plugin.
$fields = [
'style',
'details',
'style_parent',
'region',
'hoppiness',
];
return $this
->select('migrate_example_beer_topic', 'met')
->fields('met', $fields)
->orderBy('style_parent', 'ASC');
}