Commit 643dc7a4 authored by Angie Byron's avatar Angie Byron
Browse files

Issue #2452217 by mikeryan, sdstyles, benjy: Rename...

Issue #2452217 by mikeryan, sdstyles, benjy: Rename SourcePluginBase::getIterator() and try make protected
parent b2915883
Loading
Loading
Loading
Loading
+0 −11
Changes for core/modules/migrate/src/Plugin/MigrateSourceInterface.php: 0 added lines, 11 removed lines.
Original line number Diff line number Diff line
@@ -30,17 +30,6 @@ interface MigrateSourceInterface extends \Countable, \Iterator, PluginInspection
   */
  public function fields();

  /**
   * Returns the iterator that will yield the row arrays to be processed.
   *
   * @return \Iterator
   *   The iterator object.
   *
   * @throws \Exception
   *   Cannot obtain a valid iterator.
   */
  public function getIterator();

  /**
   * Add additional data to the row.
   *
+1 −1
Changes for core/modules/migrate/src/Plugin/migrate/source/SourcePluginBase.php: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -213,7 +213,7 @@ public function prepareRow(Row $row) {
   *
   * @return \Iterator
   */
  public function getIterator() {
  protected function getIterator() {
    if (!isset($this->iterator)) {
      $this->iterator = $this->initializeIterator();
    }
+0 −3
Changes for core/modules/migrate/tests/src/Unit/MigrateExecutableTest.php: 0 added lines, 3 removed lines.
Original line number Diff line number Diff line
@@ -430,9 +430,6 @@ protected function getMockSource() {
      ->disableOriginalConstructor()
      ->setMethods(get_class_methods($class))
      ->getMockForAbstractClass();
    $source->expects($this->any())
      ->method('getIterator')
      ->will($this->returnValue($iterator));
    $source->expects($this->once())
      ->method('rewind')
      ->will($this->returnValue(TRUE));
+3 −4
Changes for core/modules/taxonomy/src/Plugin/migrate/builder/d6/TermNode.php: 3 added lines, 4 removed lines.
Original line number Diff line number Diff line
@@ -78,11 +78,10 @@ protected function getVocabularyIdMap(array $source) {
    // Only process the destination ID properties.
    $process = array_intersect_key($template['process'], $migration->getDestinationPlugin()->getIds());

    foreach ($migration->getSourcePlugin()->getIterator() as $source_row) {
      $row = new Row($source_row, $source_row);
    foreach ($migration->getSourcePlugin() as $source_row) {
      // Process the row to generate the expected destination ID.
      $executable->processRow($row, $process);
      $map[$row->getSourceProperty('vid')] = $row->getDestinationProperty('vid');
      $executable->processRow($source_row, $process);
      $map[$source_row->getSourceProperty('vid')] = $source_row->getDestinationProperty('vid');
    }

    return $map;