You are here

protected function Accordionblock::_getBlockId in Accordion Blocks 8

Parameters

type $module:

type $delta:

1 call to Accordionblock::_getBlockId()
Accordionblock::prepareRow in src/Plugin/migrate/source/Accordionblock.php
Adds additional data to the row.

File

src/Plugin/migrate/source/Accordionblock.php, line 77

Class

Accordionblock
Accordion block source from database

Namespace

Drupal\accordion_blocks\Plugin\migrate\source

Code

protected function _getBlockId($module, $delta) {
  $db = \Drupal::database();
  $data = $db
    ->select('migrate_map_d7_block', 'mm')
    ->fields('mm', [
    'sourceid1',
    'sourceid2',
    'sourceid3',
    'destid1',
  ])
    ->condition('sourceid1', $module, '=')
    ->condition('sourceid2', $delta, '=')
    ->execute();
  foreach ($data as $key => $value) {
    print_r($key);
    print_r($value);
    if (!empty($value->destid1)) {
      return $value->destid1;
    }
  }
}