Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. Sql.php

function Sql::rewind

Implementation of \Iterator::rewind().

This is called before beginning a foreach loop.

File

core/modules/migrate/src/Plugin/migrate/id_map/Sql.php, line 911

Class

Sql
Defines the sql based ID map implementation.

Namespace

Drupal\migrate\Plugin\migrate\id_map

Code

public function rewind() : void {
    $this->currentRow = NULL;
    $fields = [];
    foreach ($this->sourceIdFields() as $field) {
        $fields[] = $field;
    }
    foreach ($this->destinationIdFields() as $field) {
        $fields[] = $field;
    }
    $this->result = $this->getDatabase()
        ->select($this->mapTableName(), 'map')
        ->fields('map', $fields)
        ->orderBy('destid1')
        ->execute();
    $this->next();
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal