You are here

public function CommentEntityTranslation::checkRequirements in Drupal 10

Same name and namespace in other branches
  1. 9 core/modules/comment/src/Plugin/migrate/source/d7/CommentEntityTranslation.php \Drupal\comment\Plugin\migrate\source\d7\CommentEntityTranslation::checkRequirements()

Checks if requirements for this plugin are OK.

Throws

\Drupal\migrate\Exception\RequirementsException Thrown when requirements are not met.

Overrides DrupalSqlBase::checkRequirements

File

core/modules/comment/src/Plugin/migrate/source/d7/CommentEntityTranslation.php, line 112

Class

CommentEntityTranslation
Drupal 7 comment entity translation source plugin.

Namespace

Drupal\comment\Plugin\migrate\source\d7

Code

public function checkRequirements() {
  parent::checkRequirements();
  if (!$this
    ->moduleExists('comment')) {

    // If we make it to here, the comment module isn't installed.
    throw new RequirementsException('The module comment is not enabled in the source site');
  }
  if (!$this
    ->moduleExists('node')) {

    // Node module is also a requirement.
    throw new RequirementsException('The module node is not enabled in the source site');
  }
}