abstract class MigrateUpgradeFormBase in Drupal 8
Same name and namespace in other branches
- 9 core/modules/migrate_drupal_ui/src/Form/MigrateUpgradeFormBase.php \Drupal\migrate_drupal_ui\Form\MigrateUpgradeFormBase
- 10 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, LinkGeneratorTrait, RedirectDestinationTrait, UrlGeneratorTrait, 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.
list($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 | An array of entity type IDs keyed by the property name of their storages. | |
DependencySerializationTrait:: |
protected | property | An array of service IDs keyed by property name used for serialization. | |
DependencySerializationTrait:: |
public | function | 1 | |
DependencySerializationTrait:: |
public | function | 2 | |
FormBase:: |
protected | property | The request stack. | 1 |
FormBase:: |
protected | property | The route match. | |
FormBase:: |
protected | function | Retrieves a configuration object. | |
FormBase:: |
protected | function | Gets the config factory for this form. | 1 |
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. Overrides UrlGeneratorTrait:: |
|
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:: |
62 |
FormInterface:: |
public | function | Returns a unique string identifying the form. | 236 |
FormInterface:: |
public | function | Form submission handler. | 192 |
LinkGeneratorTrait:: |
protected | property | The link generator. | 1 |
LinkGeneratorTrait:: |
protected | function | Returns the link generator. | |
LinkGeneratorTrait:: |
protected | function | Renders a link to a route given a route name and its parameters. | |
LinkGeneratorTrait:: |
public | function | Sets the link generator service. | |
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. | 29 |
MessengerTrait:: |
public | function | Gets the messenger. | 29 |
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:: |
|
MigrateUpgradeFormBase:: |
public static | function |
Instantiates a new instance of this class. Overrides FormBase:: |
|
MigrateUpgradeFormBase:: |
abstract protected | function | Returns a caption for the button that confirms the action. | |
MigrateUpgradeFormBase:: |
protected | function | Helper to redirect to the Overview form. | |
MigrateUpgradeFormBase:: |
public | function | Constructs the Migrate Upgrade Form Base. | |
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. | 1 |
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. | 2 |
StringTranslationTrait:: |
protected | function | Translates a string to the current language or to a given language. | |
UrlGeneratorTrait:: |
protected | property | The url generator. | |
UrlGeneratorTrait:: |
protected | function | Returns the URL generator service. | |
UrlGeneratorTrait:: |
public | function | Sets the URL generator service. | |
UrlGeneratorTrait:: |
protected | function | Generates a URL or path for a specific route based on the given parameters. |