function SqlBase::checkRequirements

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

Overrides RequirementsInterface::checkRequirements

1 method overrides SqlBase::checkRequirements()
DrupalSqlBase::checkRequirements in core/modules/migrate_drupal/src/Plugin/migrate/source/DrupalSqlBase.php
Checks if requirements for this plugin are OK.

File

core/modules/migrate/src/Plugin/migrate/source/SqlBase.php, line 212

Class

SqlBase
Sources whose data may be fetched via a database connection.

Namespace

Drupal\migrate\Plugin\migrate\source

Code

public function checkRequirements() {
    if ($this->pluginDefinition['requirements_met'] === TRUE) {
        try {
            $this->getDatabase();
        } catch (\PDOException|DatabaseException $e) {
            throw new RequirementsException("No database connection available for source plugin " . $this->pluginId, [], 0, $e);
        }
    }
}

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