abstract class MigrateUpgradeFormBase in Drupal 10
Same name and namespace in other branches
- 8 core/modules/migrate_drupal_ui/src/Form/MigrateUpgradeFormBase.php \Drupal\migrate_drupal_ui\Form\MigrateUpgradeFormBase
- 9 core/modules/migrate_drupal_ui/src/Form/MigrateUpgradeFormBase.php \Drupal\migrate_drupal_ui\Form\MigrateUpgradeFormBase
Form base for the Migrate Upgrade UI.
Hierarchy
- class \Drupal\Core\Form\FormBase implements ContainerInjectionInterface, FormInterface uses DependencySerializationTrait, LoggerChannelTrait, MessengerTrait, RedirectDestinationTrait, StringTranslationTrait
- class \Drupal\migrate_drupal_ui\Form\MigrateUpgradeFormBase uses MigrationConfigurationTrait
Expanded class hierarchy of MigrateUpgradeFormBase
File
- core/
modules/ migrate_drupal_ui/ src/ Form/ MigrateUpgradeFormBase.php, line 17
Namespace
Drupal\migrate_drupal_ui\FormView source
abstract class MigrateUpgradeFormBase extends FormBase {
use MigrationConfigurationTrait;
/**
* Private temporary storage.
*
* @var \Drupal\Core\TempStore\PrivateTempStoreFactory
*/
protected $store;
/**
* The destination site major version.
*
* @var string
*/
protected $destinationSiteVersion;
/**
* Constructs the Migrate Upgrade Form Base.
*
* @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory
* The config factory service.
* @param \Drupal\migrate\Plugin\MigrationPluginManagerInterface $migration_plugin_manager
* The migration plugin manager service.
* @param \Drupal\Core\State\StateInterface $state
* The state service.
* @param \Drupal\Core\TempStore\PrivateTempStoreFactory $tempstore_private
* The private tempstore factory service.
*/
public function __construct(ConfigFactoryInterface $config_factory, MigrationPluginManagerInterface $migration_plugin_manager, StateInterface $state, PrivateTempStoreFactory $tempstore_private) {
$this->configFactory = $config_factory;
$this->migrationPluginManager = $migration_plugin_manager;
$this->state = $state;
$this->store = $tempstore_private
->get('migrate_drupal_ui');
}
/**
* {@inheritdoc}
*/
public static function create(ContainerInterface $container) {
return new static($container
->get('config.factory'), $container
->get('plugin.manager.migration'), $container
->get('state'), $container
->get('tempstore.private'));
}
/**
* {@inheritdoc}
*/
public function buildForm(array $form, FormStateInterface $form_state) {
// Get the current major version.
[
$this->destinationSiteVersion,
] = explode('.', \Drupal::VERSION, 2);
$form = [];
$form['actions']['#type'] = 'actions';
$form['actions']['submit'] = [
'#type' => 'submit',
'#value' => $this
->getConfirmText(),
'#button_type' => 'primary',
'#weight' => 10,
];
return $form;
}
/**
* Helper to redirect to the Overview form.
*
* @return \Symfony\Component\HttpFoundation\RedirectResponse
* A redirect response object that may be returned by the controller.
*
* @throws \Drupal\Core\TempStore\TempStoreException
* Thrown when a lock for the backend storage could not be acquired.
*/
protected function restartUpgradeForm() {
$this->store
->set('step', 'overview');
return $this
->redirect('migrate_drupal_ui.upgrade');
}
/**
* Returns a caption for the button that confirms the action.
*
* @return string
* The form confirmation text.
*/
protected abstract function getConfirmText();
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
DependencySerializationTrait:: |
protected | property | ||
DependencySerializationTrait:: |
protected | property | ||
DependencySerializationTrait:: |
public | function | 2 | |
DependencySerializationTrait:: |
public | function | 2 | |
FormBase:: |
protected | property | The request stack. | |
FormBase:: |
protected | property | The route match. | |
FormBase:: |
protected | function | Retrieves a configuration object. | |
FormBase:: |
protected | function | Gets the config factory for this form. | 3 |
FormBase:: |
private | function | Returns the service container. | |
FormBase:: |
protected | function | Gets the current user. | |
FormBase:: |
protected | function | Gets the request object. | |
FormBase:: |
protected | function | Gets the route match. | |
FormBase:: |
protected | function | Gets the logger for a specific channel. | |
FormBase:: |
protected | function | Returns a redirect response object for the specified route. | |
FormBase:: |
public | function | Resets the configuration factory. | |
FormBase:: |
public | function | Sets the config factory for this form. | |
FormBase:: |
public | function | Sets the request stack object to use. | |
FormBase:: |
public | function |
Form validation handler. Overrides FormInterface:: |
65 |
FormInterface:: |
public | function | Returns a unique string identifying the form. | 239 |
FormInterface:: |
public | function | Form submission handler. | 201 |
LoggerChannelTrait:: |
protected | property | The logger channel factory service. | |
LoggerChannelTrait:: |
protected | function | Gets the logger for a specific channel. | |
LoggerChannelTrait:: |
public | function | Injects the logger channel factory. | |
MessengerTrait:: |
protected | property | The messenger. | 18 |
MessengerTrait:: |
public | function | Gets the messenger. | 18 |
MessengerTrait:: |
public | function | Sets the messenger. | |
MigrateUpgradeFormBase:: |
protected | property | The destination site major version. | |
MigrateUpgradeFormBase:: |
protected | property | Private temporary storage. | |
MigrateUpgradeFormBase:: |
public | function |
Form constructor. Overrides FormInterface:: |
5 |
MigrateUpgradeFormBase:: |
public static | function |
Instantiates a new instance of this class. Overrides FormBase:: |
3 |
MigrateUpgradeFormBase:: |
abstract protected | function | Returns a caption for the button that confirms the action. | 5 |
MigrateUpgradeFormBase:: |
protected | function | Helper to redirect to the Overview form. | |
MigrateUpgradeFormBase:: |
public | function | Constructs the Migrate Upgrade Form Base. | 3 |
MigrationConfigurationTrait:: |
protected | property | The config factory service. | |
MigrationConfigurationTrait:: |
protected | property | The follow-up migration tags. | |
MigrationConfigurationTrait:: |
protected | property | The migration plugin manager service. | |
MigrationConfigurationTrait:: |
protected | property | The state service. | |
MigrationConfigurationTrait:: |
protected | function | Creates the necessary state entries for SqlBase::getDatabase() to work. | |
MigrationConfigurationTrait:: |
protected | function | Gets the config factory service. | |
MigrationConfigurationTrait:: |
protected | function | Gets the database connection for the source Drupal database. | |
MigrationConfigurationTrait:: |
protected | function | Returns the follow-up migration tags. | |
MigrationConfigurationTrait:: |
public static | function | Determines what version of Drupal the source database contains. | |
MigrationConfigurationTrait:: |
protected | function | Gets the migration plugin manager service. | |
MigrationConfigurationTrait:: |
protected | function | Gets the migrations for import. | |
MigrationConfigurationTrait:: |
protected | function | Gets the state service. | |
MigrationConfigurationTrait:: |
protected | function | Gets the system data from the system table of the source Drupal database. | |
RedirectDestinationTrait:: |
protected | property | The redirect destination service. | 1 |
RedirectDestinationTrait:: |
protected | function | Prepares a 'destination' URL query parameter for use with \Drupal\Core\Url. | |
RedirectDestinationTrait:: |
protected | function | Returns the redirect destination service. | |
RedirectDestinationTrait:: |
public | function | Sets the redirect destination service. | |
StringTranslationTrait:: |
protected | property | The string translation service. | 3 |
StringTranslationTrait:: |
protected | function | Formats a string containing a count of items. | |
StringTranslationTrait:: |
protected | function | Returns the number of plurals supported by a given language. | |
StringTranslationTrait:: |
protected | function | Gets the string translation service. | |
StringTranslationTrait:: |
public | function | Sets the string translation service to use. | 1 |
StringTranslationTrait:: |
protected | function | Translates a string to the current language or to a given language. |