You are here

interface MigrateSourceInterface in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 core/modules/migrate/src/Plugin/MigrateSourceInterface.php \Drupal\migrate\Plugin\MigrateSourceInterface

Defines an interface for migrate sources.

Hierarchy

Expanded class hierarchy of MigrateSourceInterface

All classes that implement MigrateSourceInterface

See also

\Drupal\migrate\Plugin\MigratePluginManager

\Drupal\migrate\Annotation\MigrateSource

\Drupal\migrate\Plugin\migrate\source\SourcePluginBase

Plugin API

Related topics

4 files declare their use of MigrateSourceInterface
migrate.api.php in core/modules/migrate/migrate.api.php
Hooks provided by the Migrate module.
migrate_prepare_row_test.module in core/modules/migrate/tests/modules/migrate_prepare_row_test/migrate_prepare_row_test.module
Test module for testing the migration source plugin prepareRow() exception handling.
MigrationTest.php in core/modules/migrate/tests/src/Unit/MigrationTest.php
Contains \Drupal\Tests\migrate\Unit\MigrationTest.
SourcePluginBase.php in core/modules/migrate/src/Plugin/migrate/source/SourcePluginBase.php
Contains \Drupal\migrate\Plugin\migrate\source\SourcePluginBase.

File

core/modules/migrate/src/Plugin/MigrateSourceInterface.php, line 22
Contains \Drupal\migrate\Plugin\MigrateSourceInterface.

Namespace

Drupal\migrate\Plugin
View source
interface MigrateSourceInterface extends \Countable, \Iterator, PluginInspectionInterface {

  /**
   * Returns available fields on the source.
   *
   * @return array
   *   Available fields in the source, keys are the field machine names as used
   *   in field mappings, values are descriptions.
   */
  public function fields();

  /**
   * Add additional data to the row.
   *
   * @param \Drupal\Migrate\Row $row
   *   The row object.
   *
   * @return bool
   *   FALSE if this row needs to be skipped.
   */
  public function prepareRow(Row $row);
  public function __toString();

  /**
   * Defines the source fields uniquely identifying a source row. None of these
   * fields should contain a NULL value - if necessary, use prepareRow() or
   * hook_migrate_prepare_row() to rewrite NULL values to appropriate empty
   * values (such as '' or 0).
   *
   * @return array
   *   Array keyed by source field name, with values being a schema array
   *   describing the field (such as ['type' => 'string]).
   */
  public function getIds();

}

Members

Namesort descending Modifiers Type Description Overrides
MigrateSourceInterface::fields public function Returns available fields on the source. 64
MigrateSourceInterface::getIds public function Defines the source fields uniquely identifying a source row. None of these fields should contain a NULL value - if necessary, use prepareRow() or hook_migrate_prepare_row() to rewrite NULL values to appropriate empty values (such as '' or 0). 64
MigrateSourceInterface::prepareRow public function Add additional data to the row. 1
MigrateSourceInterface::__toString public function 4
PluginInspectionInterface::getPluginDefinition public function Gets the definition of the plugin implementation. 2
PluginInspectionInterface::getPluginId public function Gets the plugin_id of the plugin instance. 2