You are here

public function SourcePluginBase::key in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/migrate/src/Plugin/migrate/source/SourcePluginBase.php \Drupal\migrate\Plugin\migrate\source\SourcePluginBase::key()
  2. 10 core/modules/migrate/src/Plugin/migrate/source/SourcePluginBase.php \Drupal\migrate\Plugin\migrate\source\SourcePluginBase::key()

Gets the iterator key.

Implementation of \Iterator::key() - called when entering a loop iteration, returning the key of the current row. It must be a scalar - we will serialize to fulfill the requirement, but using getCurrentIds() is preferable.

File

core/modules/migrate/src/Plugin/migrate/source/SourcePluginBase.php, line 358

Class

SourcePluginBase
The base class for source plugins.

Namespace

Drupal\migrate\Plugin\migrate\source

Code

public function key() {
  return serialize($this->currentSourceIds);
}