You are here

public function DrupalSqlBase::getSystemData in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/migrate_drupal/src/Plugin/migrate/source/DrupalSqlBase.php \Drupal\migrate_drupal\Plugin\migrate\source\DrupalSqlBase::getSystemData()

Retrieves all system data information from the source Drupal database.

Return value

array List of system table information keyed by type and name.

2 calls to DrupalSqlBase::getSystemData()
DrupalSqlBase::getModuleSchemaVersion in core/modules/migrate_drupal/src/Plugin/migrate/source/DrupalSqlBase.php
Retrieves a module schema_version from the source Drupal database.
DrupalSqlBase::moduleExists in core/modules/migrate_drupal/src/Plugin/migrate/source/DrupalSqlBase.php
Checks if a given module is enabled in the source Drupal database.

File

core/modules/migrate_drupal/src/Plugin/migrate/source/DrupalSqlBase.php, line 76

Class

DrupalSqlBase
A base class for source plugins using a Drupal database as a source.

Namespace

Drupal\migrate_drupal\Plugin\migrate\source

Code

public function getSystemData() {
  if (!isset($this->systemData)) {
    $this->systemData = [];
    try {
      $results = $this
        ->select('system', 's')
        ->fields('s')
        ->execute();
      foreach ($results as $result) {
        $this->systemData[$result['type']][$result['name']] = $result;
      }
    } catch (\Exception $e) {

      // The table might not exist for example in tests.
    }
  }
  return $this->systemData;
}