class IncrementalForm in Drupal 10
Same name and namespace in other branches
- 8 core/modules/migrate_drupal_ui/src/Form/IncrementalForm.php \Drupal\migrate_drupal_ui\Form\IncrementalForm
- 9 core/modules/migrate_drupal_ui/src/Form/IncrementalForm.php \Drupal\migrate_drupal_ui\Form\IncrementalForm
Migrate Upgrade Incremental form.
@internal
Hierarchy
- class \Drupal\Core\Form\FormBase implements ContainerInjectionInterface, FormInterface uses DependencySerializationTrait, LoggerChannelTrait, MessengerTrait, RedirectDestinationTrait, StringTranslationTrait
- class \Drupal\migrate_drupal_ui\Form\MigrateUpgradeFormBase uses MigrationConfigurationTrait
- class \Drupal\migrate_drupal_ui\Form\IncrementalForm
- class \Drupal\migrate_drupal_ui\Form\MigrateUpgradeFormBase uses MigrationConfigurationTrait
Expanded class hierarchy of IncrementalForm
1 string reference to 'IncrementalForm'
- migrate_drupal_ui.routing.yml in core/
modules/ migrate_drupal_ui/ migrate_drupal_ui.routing.yml - core/modules/migrate_drupal_ui/migrate_drupal_ui.routing.yml
File
- core/
modules/ migrate_drupal_ui/ src/ Form/ IncrementalForm.php, line 18
Namespace
Drupal\migrate_drupal_ui\FormView source
class IncrementalForm extends MigrateUpgradeFormBase {
/**
* The date formatter service.
*
* @var \Drupal\Core\Datetime\DateFormatterInterface
*/
protected $dateFormatter;
/**
* IncrementalForm constructor.
*
* @param \Drupal\Core\State\StateInterface $state
* The state service.
* @param \Drupal\Core\Datetime\DateFormatterInterface $date_formatter
* The date formatter service.
* @param \Drupal\Core\TempStore\PrivateTempStoreFactory $tempstore_private
* The private tempstore factory service.
* @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory
* The config factory service.
* @param \Drupal\migrate\Plugin\MigrationPluginManagerInterface $migration_plugin_manager
* The migration plugin manager service.
*/
public function __construct(StateInterface $state, DateFormatterInterface $date_formatter, PrivateTempStoreFactory $tempstore_private, ConfigFactoryInterface $config_factory, MigrationPluginManagerInterface $migration_plugin_manager) {
parent::__construct($config_factory, $migration_plugin_manager, $state, $tempstore_private);
$this->dateFormatter = $date_formatter;
}
/**
* {@inheritdoc}
*/
public static function create(ContainerInterface $container) {
return new static($container
->get('state'), $container
->get('date.formatter'), $container
->get('tempstore.private'), $container
->get('config.factory'), $container
->get('plugin.manager.migration'));
}
/**
* {@inheritdoc}
*/
public function getFormId() {
return 'migrate_drupal_ui_incremental_form';
}
/**
* {@inheritdoc}
*/
public function buildForm(array $form, FormStateInterface $form_state) {
// Get all the data needed for this form.
$date_performed = $this->state
->get('migrate_drupal_ui.performed');
// If data is missing or this is the wrong step, start over.
if (!$date_performed || $this->store
->get('step') != 'incremental') {
return $this
->restartUpgradeForm();
}
$form = parent::buildForm($form, $form_state);
$form['#title'] = $this
->t('Upgrade');
// @todo Add back support for rollbacks.
// https://www.drupal.org/node/2687849
$form['upgrade_option_item'] = [
'#type' => 'item',
'#prefix' => $this
->t('An upgrade has already been performed on this site. To perform a new migration, create a clean and empty new install of Drupal @version. Rollbacks are not yet supported through the user interface. For more information, see the <a href=":url">upgrading handbook</a>.', [
'@version' => $this->destinationSiteVersion,
':url' => 'https://www.drupal.org/upgrade/migrate',
]),
'#description' => $this
->t('Last upgrade: @date', [
'@date' => $this->dateFormatter
->format($date_performed),
]),
];
return $form;
}
/**
* {@inheritdoc}
*/
public function submitForm(array &$form, FormStateInterface $form_state) {
$this->store
->set('step', 'credential');
$form_state
->setRedirect('migrate_drupal_ui.upgrade_credential');
}
/**
* {@inheritdoc}
*/
public function getConfirmText() {
return $this
->t('Import new configuration and content from old site');
}
}
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 |
IncrementalForm:: |
protected | property | The date formatter service. | |
IncrementalForm:: |
public | function |
Form constructor. Overrides MigrateUpgradeFormBase:: |
|
IncrementalForm:: |
public static | function |
Instantiates a new instance of this class. Overrides MigrateUpgradeFormBase:: |
|
IncrementalForm:: |
public | function |
Returns a caption for the button that confirms the action. Overrides MigrateUpgradeFormBase:: |
|
IncrementalForm:: |
public | function |
Returns a unique string identifying the form. Overrides FormInterface:: |
|
IncrementalForm:: |
public | function |
Form submission handler. Overrides FormInterface:: |
|
IncrementalForm:: |
public | function |
IncrementalForm constructor. Overrides MigrateUpgradeFormBase:: |
|
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:: |
protected | function | Helper to redirect to the Overview form. | |
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. |