You are here

public function Block::query in Drupal 9

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()

Return value

\Drupal\Core\Database\Query\SelectInterface

Overrides SqlBase::query

2 calls to 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
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 60

Class

Block
Drupal 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');
}