You are here

public function MigrateSourceMultiItems::performRewind in Migrate 7.2

Same name and namespace in other branches
  1. 6.2 plugins/sources/multiitems.inc \MigrateSourceMultiItems::performRewind()

Implementation of MigrateSource::performRewind().

Return value

void

File

plugins/sources/multiitems.inc, line 158
Support for migration from sources where data spans multiple lines (ex. xml, json) and IDs for the items are part of each item and multiple items reside in a single file.

Class

MigrateSourceMultiItems
Implementation of MigrateSource, providing the semantics of iterating over IDs provided by a MigrateItems and retrieving data from a MigrateItems.

Code

public function performRewind() {

  // If there isn't a specific ID list passed in, get it from the list class.
  if ($this->idList) {
    $this->idsToProcess = $this->idList;
  }
  elseif (!($this->idsToProcess = $this->itemsClass
    ->getIdList())) {
    $this->idsToProcess = array();
  }
  $this->idIterator = $this->idsToProcess instanceof Iterator ? $this->idsToProcess : new ArrayIterator($this->idsToProcess);
  $this->idIterator
    ->rewind();
}