PrepareModulesEntityUninstallForm
class PrepareModulesEntityUninstallForm extends ConfirmFormBase (View source)
| internal |
Provides a form removing module content entities data before uninstallation.
Traits
Provides dependency injection friendly methods for serialization.
Wrapper methods for the Link Generator.
Wrapper methods for the logger factory service.
Provides a trait for the messenger service.
Wrapper methods for the Redirect Destination.
Wrapper methods for \Drupal\Core\StringTranslation\TranslationInterface.
Wrapper methods for the Url Generator.
Properties
| protected array | $_serviceIds | An array of service IDs keyed by property name used for serialization. |
from DependencySerializationTrait |
| protected array | $_entityStorages | An array of entity type IDs keyed by the property name of their storages. |
from DependencySerializationTrait |
| protected LinkGeneratorInterface | $linkGenerator | The link generator. |
from LinkGeneratorTrait |
| protected LoggerChannelFactoryInterface | $loggerFactory | The logger channel factory service. |
from LoggerChannelTrait |
| protected MessengerInterface | $messenger | The messenger. |
from MessengerTrait |
| protected RedirectDestinationInterface | $redirectDestination | The redirect destination service. |
from RedirectDestinationTrait |
| protected TranslationInterface | $stringTranslation | The string translation service. |
from StringTranslationTrait |
| protected UrlGeneratorInterface | $urlGenerator | The url generator. |
from UrlGeneratorTrait |
| protected RequestStack | $requestStack | The request stack. |
from FormBase |
| protected ConfigFactoryInterface | $configFactory | The config factory. |
from FormBase |
| protected RouteMatchInterface | $routeMatch | The route match. |
from FormBase |
| protected string | $entityTypeId | The entity type ID of the entities to delete. |
|
| protected EntityTypeManagerInterface | $entityTypeManager | The entity type manager. |
Methods
Gets the logger for a specific channel.
Prepares a 'destination' URL query parameter for use with \Drupal\Core\Url.
Returns the redirect destination service.
Sets the redirect destination service.
Translates a string to the current language or to a given language.
Formats a string containing a count of items.
Returns the number of plurals supported by a given language.
Gets the string translation service.
Generates a URL or path for a specific route based on the given parameters.
Returns a redirect response object for the specified route.
Instantiates a new instance of this class.
Sets the request stack object to use.
Returns additional text to display as a description.
Returns a caption for the button that confirms the action.
Returns a caption for the link which cancels the action.
Returns the internal name used to refer to the confirmation item.
Constructs a PrepareModulesEntityUninstallForm object.
Returns a unique string identifying the form.
Returns the question to ask the user.
Returns the route to go to if the user cancels the action.
Deletes the content entities of the specified entity type.
Implements callback_batch_finished().
Details
__sleep()
{@inheritdoc}
__wakeup()
{@inheritdoc}
protected GeneratedLink
l($text, Url $url)
deprecated
deprecated
Renders a link to a route given a route name and its parameters.
For details on the arguments, usage, and possible exceptions see \Drupal\Core\Utility\LinkGeneratorInterface::generate().
protected LinkGeneratorInterface
getLinkGenerator()
deprecated
deprecated
Returns the link generator.
$this
setLinkGenerator(LinkGeneratorInterface $generator)
deprecated
deprecated
Sets the link generator service.
protected LoggerInterface
getLogger(string $channel)
Gets the logger for a specific channel.
$this
setLoggerFactory(LoggerChannelFactoryInterface $logger_factory)
Injects the logger channel factory.
setMessenger(MessengerInterface $messenger)
Sets the messenger.
MessengerInterface
messenger()
Gets the messenger.
protected array
getDestinationArray()
Prepares a 'destination' URL query parameter for use with \Drupal\Core\Url.
protected RedirectDestinationInterface
getRedirectDestination()
Returns the redirect destination service.
$this
setRedirectDestination(RedirectDestinationInterface $redirect_destination)
Sets the redirect destination service.
protected TranslatableMarkup
t(string $string, array $args = [], array $options = [])
Translates a string to the current language or to a given language.
See \Drupal\Core\StringTranslation\TranslatableMarkup::__construct() for important security information and usage guidelines.
In order for strings to be localized, make them available in one of the ways supported by the
protected
formatPlural($count, $singular, $plural, array $args = [], array $options = [])
Formats a string containing a count of items.
protected
getNumberOfPlurals($langcode = NULL)
Returns the number of plurals supported by a given language.
protected TranslationInterface
getStringTranslation()
Gets the string translation service.
$this
setStringTranslation(TranslationInterface $translation)
Sets the string translation service to use.
protected string
url($route_name, $route_parameters = [], $options = [])
deprecated
deprecated
Generates a URL or path for a specific route based on the given parameters.
For details on the arguments, usage, and possible exceptions see \Drupal\Core\Routing\UrlGeneratorInterface::generateFromRoute().
protected RedirectResponse
redirect(string $route_name, array $route_parameters = [], array $options = [], int $status = 302)
deprecated
deprecated
Returns a redirect response object for the specified route.
protected UrlGeneratorInterface
getUrlGenerator()
deprecated
deprecated
Returns the URL generator service.
$this
setUrlGenerator(UrlGeneratorInterface $generator)
deprecated
deprecated
Sets the URL generator service.
static
create(ContainerInterface $container)
Instantiates a new instance of this class.
This is a factory method that returns a new instance of this class. The factory should pass any needed dependencies into the constructor of this class, but not the container itself. Every call to this method must return a new instance of this class; that is, it may not implement a singleton.
validateForm(array $form, FormStateInterface $form_state)
Form validation handler.
protected ImmutableConfig
config(string $name)
Retrieves a configuration object.
This is the main entry point to the configuration API. Calling
protected ConfigFactoryInterface
configFactory()
Gets the config factory for this form.
When accessing configuration values, use $this->config(). Only use this when the config factory needs to be manipulated directly.
$this
setConfigFactory(ConfigFactoryInterface $config_factory)
Sets the config factory for this form.
resetConfigFactory()
Resets the configuration factory.
protected Request
getRequest()
Gets the request object.
protected RouteMatchInterface
getRouteMatch()
Gets the route match.
$this
setRequestStack(RequestStack $request_stack)
Sets the request stack object to use.
protected AccountInterface
currentUser()
Gets the current user.
protected LoggerInterface
logger(string $channel)
Gets the logger for a specific channel.
This method exists for backward-compatibility between FormBase and LoggerChannelTrait. Use LoggerChannelTrait::getLogger() instead.
TranslatableMarkup
getDescription()
Returns additional text to display as a description.
TranslatableMarkup
getConfirmText()
Returns a caption for the button that confirms the action.
TranslatableMarkup
getCancelText()
Returns a caption for the link which cancels the action.
string
getFormName()
Returns the internal name used to refer to the confirmation item.
array
buildForm(array $form, FormStateInterface $form_state, $entity_type_id = NULL)
Form constructor.
__construct(EntityTypeManagerInterface $entity_type_manager)
Constructs a PrepareModulesEntityUninstallForm object.
string
getFormId()
Returns a unique string identifying the form.
The returned ID should be a unique string that can be a valid PHP function name, since it's used in hook implementation names such as hook_form_FORM_ID_alter().
TranslatableMarkup
getQuestion()
Returns the question to ask the user.
Url
getCancelUrl()
Returns the route to go to if the user cancels the action.
submitForm(array $form, FormStateInterface $form_state)
Form submission handler.
static
deleteContentEntities(string $entity_type_id, array|ArrayAccess $context)
| internal | This batch callback is only meant to be used by this form. |
Deletes the content entities of the specified entity type.
static
moduleBatchFinished($success, $results, $operations)
Implements callback_batch_finished().
Finishes the module batch, redirect to the uninstall page and output the successful data deletion message.