HighWaterTest.php in Drupal 10
File
core/modules/migrate/tests/modules/migrate_high_water_test/src/Plugin/migrate/source/HighWaterTest.php
View source
<?php
namespace Drupal\migrate_high_water_test\Plugin\migrate\source;
use Drupal\migrate\Plugin\migrate\source\SqlBase;
class HighWaterTest extends SqlBase {
public function query() {
$field_names = array_keys($this
->fields());
$query = $this
->select('high_water_node', 'm')
->fields('m', $field_names);
foreach ($field_names as $field_name) {
$query
->groupBy($field_name);
}
return $query;
}
public function fields() {
$fields = [
'id' => $this
->t('Id'),
'title' => $this
->t('Title'),
'changed' => $this
->t('Changed'),
];
return $fields;
}
public function getIds() {
return [
'id' => [
'type' => 'integer',
],
];
}
}