You are here

public function MigrateXMLReader::rewind in Migrate 6.2

Same name and namespace in other branches
  1. 7.2 plugins/sources/xml.inc \MigrateXMLReader::rewind()

Implementation of Iterator::rewind().

Return value

void

File

plugins/sources/xml.inc, line 710
Support for migration from XML sources.

Class

MigrateXMLReader
Makes an XMLReader object iterable, returning elements matching a restricted xpath-like syntax.

Code

public function rewind() {

  // (Re)open the provided URL.
  $this->reader
    ->close();
  $status = $this->reader
    ->open($this->url);
  if (!$status) {
    Migration::displayMessage(t('Could not open XML file !url', array(
      '!url' => $this->url,
    )));
  }

  // Reset our path tracker
  $this->currentPath = array();

  // Load the first matching element and its ID.
  $this
    ->next();
}