You are here

protected function CommentType::initializeIterator in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/comment/src/Plugin/migrate/source/d7/CommentType.php \Drupal\comment\Plugin\migrate\source\d7\CommentType::initializeIterator()

Implementation of MigrateSource::performRewind().

We could simply execute the query and be functionally correct, but we will take advantage of the PDO-based API to optimize the query up-front.

Overrides SqlBase::initializeIterator

File

core/modules/comment/src/Plugin/migrate/source/d7/CommentType.php, line 44
Contains \Drupal\comment\Plugin\migrate\source\d7\CommentType.

Class

CommentType
Drupal 7 comment type source from database.

Namespace

Drupal\comment\Plugin\migrate\source\d7

Code

protected function initializeIterator() {
  $this->nodeTypes = $this
    ->select('node_type', 'nt')
    ->fields('nt', array(
    'type',
    'name',
  ))
    ->execute()
    ->fetchAllKeyed();
  return parent::initializeIterator();
}