TrackChangesTest.php in Drupal 10
File
core/modules/migrate/tests/modules/migrate_track_changes_test/src/Plugin/migrate/source/TrackChangesTest.php
View source
<?php
namespace Drupal\migrate_track_changes_test\Plugin\migrate\source;
use Drupal\migrate\Plugin\migrate\source\SqlBase;
class TrackChangesTest extends SqlBase {
public function query() {
$field_names = array_keys($this
->fields());
$query = $this
->select('track_changes_term', 't')
->fields('t', $field_names);
foreach ($field_names as $field_name) {
$query
->groupBy($field_name);
}
return $query;
}
public function fields() {
$fields = [
'tid' => $this
->t('Term id'),
'name' => $this
->t('Name'),
'description' => $this
->t('Description'),
];
return $fields;
}
public function getIds() {
return [
'tid' => [
'type' => 'integer',
],
];
}
}