You are here

public function Block::query in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/block/src/Plugin/migrate/source/Block.php \Drupal\block\Plugin\migrate\source\Block::query()
  2. 9 core/modules/block/src/Plugin/migrate/source/Block.php \Drupal\block\Plugin\migrate\source\Block::query()

Return value

\Drupal\Core\Database\Query\SelectInterface

Overrides SqlBase::query

2 methods override Block::query()
BlockTranslation::query in core/modules/block/src/Plugin/migrate/source/d6/BlockTranslation.php
BlockTranslation::query in core/modules/block/src/Plugin/migrate/source/d7/BlockTranslation.php

File

core/modules/block/src/Plugin/migrate/source/Block.php, line 63

Class

Block
Drupal 6/7 block source from database.

Namespace

Drupal\block\Plugin\migrate\source

Code

public function query() {
  if ($this
    ->getModuleSchemaVersion('system') >= 7000) {
    $this->blockTable = 'block';
    $this->blockRoleTable = 'block_role';
  }
  else {
    $this->blockTable = 'blocks';
    $this->blockRoleTable = 'blocks_roles';
  }

  // Drupal 6 & 7 both use the same name for the user roles table.
  $this->userRoleTable = 'role';
  return $this
    ->select($this->blockTable, 'b')
    ->fields('b');
}