TrackChangesTest.php

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

Namespace

Drupal\migrate_track_changes_test\Plugin\migrate\source

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;

/**
 * Source plugin for migration track changes tests.
 *
 * @MigrateSource(
 *   id = "track_changes_test"
 * )
 */
class TrackChangesTest extends SqlBase {
    
    /**
     * {@inheritdoc}
     */
    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;
    }
    
    /**
     * {@inheritdoc}
     */
    public function fields() {
        $fields = [
            'tid' => $this->t('Term id'),
            'name' => $this->t('Name'),
            'description' => $this->t('Description'),
        ];
        return $fields;
    }
    
    /**
     * {@inheritdoc}
     */
    public function getIds() {
        return [
            'tid' => [
                'type' => 'integer',
            ],
        ];
    }

}

Classes

Title Deprecated Summary
TrackChangesTest Source plugin for migration track changes tests.

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