function MigrationConfigurationTrait::getState

Same name in other branches
  1. 9 core/modules/migrate_drupal/src/MigrationConfigurationTrait.php \Drupal\migrate_drupal\MigrationConfigurationTrait::getState()
  2. 8.9.x core/modules/migrate_drupal/src/MigrationConfigurationTrait.php \Drupal\migrate_drupal\MigrationConfigurationTrait::getState()
  3. 11.x core/modules/migrate_drupal/src/MigrationConfigurationTrait.php \Drupal\migrate_drupal\MigrationConfigurationTrait::getState()

Gets the state service.

Return value

\Drupal\Core\State\StateInterface The state service.

1 call to MigrationConfigurationTrait::getState()
MigrationConfigurationTrait::createDatabaseStateSettings in core/modules/migrate_drupal/src/MigrationConfigurationTrait.php
Creates the necessary state entries for SqlBase::getDatabase() to work.

File

core/modules/migrate_drupal/src/MigrationConfigurationTrait.php, line 262

Class

MigrationConfigurationTrait
Configures the appropriate migrations for a given source Drupal database.

Namespace

Drupal\migrate_drupal

Code

protected function getState() {
    if (!$this->state) {
        $this->state = \Drupal::service('state');
    }
    return $this->state;
}

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