function Block::query

Same name in other branches
  1. 9 core/modules/block/src/Plugin/migrate/source/Block.php \Drupal\block\Plugin\migrate\source\Block::query()
  2. 8.9.x core/modules/block/src/Plugin/migrate/source/Block.php \Drupal\block\Plugin\migrate\source\Block::query()
  3. 10 core/modules/block/src/Plugin/migrate/source/Block.php \Drupal\block\Plugin\migrate\source\Block::query()

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

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.