HighWaterTest.php

Same filename in this branch
  1. 8.9.x core/modules/migrate/tests/src/Kernel/HighWaterTest.php
Same filename in other branches
  1. 9 core/modules/migrate/tests/src/Kernel/HighWaterTest.php
  2. 9 core/modules/migrate/tests/modules/migrate_high_water_test/src/Plugin/migrate/source/HighWaterTest.php
  3. 10 core/modules/migrate/tests/src/Kernel/HighWaterTest.php
  4. 10 core/modules/migrate/tests/modules/migrate_high_water_test/src/Plugin/migrate/source/HighWaterTest.php
  5. 11.x core/modules/migrate/tests/src/Kernel/HighWaterTest.php
  6. 11.x core/modules/migrate/tests/modules/migrate_high_water_test/src/Plugin/migrate/source/HighWaterTest.php

Namespace

Drupal\migrate_high_water_test\Plugin\migrate\source

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;

/**
 * Source plugin for migration high water tests.
 *
 * @MigrateSource(
 *   id = "high_water_test"
 * )
 */
class HighWaterTest extends SqlBase {
    
    /**
     * {@inheritdoc}
     */
    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;
    }
    
    /**
     * {@inheritdoc}
     */
    public function fields() {
        $fields = [
            'id' => $this->t('Id'),
            'title' => $this->t('Title'),
            'changed' => $this->t('Changed'),
        ];
        return $fields;
    }
    
    /**
     * {@inheritdoc}
     */
    public function getIds() {
        return [
            'id' => [
                'type' => 'integer',
            ],
        ];
    }

}

Classes

Title Deprecated Summary
HighWaterTest Source plugin for migration high water tests.

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