public function MediaEntityGeneratorD7::query in Migrate File Entities to Media Entities 8
Return value
\Drupal\Core\Database\Query\SelectInterface
Overrides Node::query
File
- src/
Plugin/ migrate/ source/ MediaEntityGeneratorD7.php, line 149
Class
- MediaEntityGeneratorD7
- Returns bare-bones information about every available file entity.
Namespace
Drupal\migrate_file_to_media\Plugin\migrate\sourceCode
public function query() {
// Select node in its last revision.
$query = $this
->select('node_revision', 'nr')
->fields('n', [
'nid',
'type',
'language',
'status',
'created',
'changed',
'comment',
'promote',
'sticky',
'tnid',
'translate',
])
->fields('nr', [
'vid',
'title',
'log',
'timestamp',
]);
$query
->addField('n', 'uid', 'node_uid');
$query
->addField('nr', 'uid', 'revision_uid');
$query
->innerJoin('node', 'n', static::JOIN);
// If the content_translation module is enabled, get the source langcode
// to fill the content_translation_source field.
if ($this->moduleHandler
->moduleExists('content_translation')) {
$query
->leftJoin('node', 'nt', 'n.tnid = nt.nid');
$query
->addField('nt', 'language', 'source_langcode');
}
$this
->handleTranslations($query);
if (isset($this->configuration['bundle'])) {
$query
->condition('n.type', $this->configuration['bundle']);
}
return $query;
}