class ReviewUserForm in User Merge 2.x
Class MergeAccountsForm.
@package Drupal\usermerge\Form
Hierarchy
- class \Drupal\Core\Form\FormBase implements ContainerInjectionInterface, FormInterface uses DependencySerializationTrait, LoggerChannelTrait, MessengerTrait, RedirectDestinationTrait, StringTranslationTrait
- class \Drupal\usermerge\Form\MultiStepFormBase
- class \Drupal\usermerge\Form\ReviewUserForm
- class \Drupal\usermerge\Form\MultiStepFormBase
Expanded class hierarchy of ReviewUserForm
File
- src/
Form/ ReviewUserForm.php, line 12
Namespace
Drupal\usermerge\FormView source
class ReviewUserForm extends MultiStepFormBase {
/**
* {@inheritdoc}
*/
public function getFormId() {
return 'usermerge_review_user';
}
/**
* {@inheritdoc}
*/
public function buildForm(array $form, FormStateInterface $form_state) {
$retire = $this->multiStepStorage
->getRetiredAccount();
$retain = $this->multiStepStorage
->getRetainedAccount();
$form['data'] = [];
$form['data']['core'] = [
'#type' => 'table',
'#header' => [
$this
->t('Property'),
$this
->t('Retired account'),
$this
->t('Retained account'),
],
];
$row = 1;
$discarded = [
'uid' => 'id',
'uuid' => 'uuid',
'name' => 'getAccountName',
'email' => 'getEmail',
];
foreach ($discarded as $property => $method) {
$form['data']['core'][$row]['property'] = [
'#markup' => $property,
];
$form['data']['core'][$row]['retire'] = [
'#markup' => $retire
->{$method}(),
];
$form['data']['core'][$row]['retain'] = [
'#markup' => $retain
->{$method}(),
];
$row++;
}
// Add submit buttons.
$form = parent::buildForm($form, $form_state);
return $form;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
DependencySerializationTrait:: |
protected | property | ||
DependencySerializationTrait:: |
protected | property | ||
DependencySerializationTrait:: |
public | function | 2 | |
DependencySerializationTrait:: |
public | function | 2 | |
FormBase:: |
protected | property | The config factory. | 3 |
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. | 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:: |
72 |
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. | 27 |
MessengerTrait:: |
public | function | Gets the messenger. | 27 |
MessengerTrait:: |
public | function | Sets the messenger. | |
MultiStepFormBase:: |
protected | property | Batch generator. | |
MultiStepFormBase:: |
protected | property | Multi step storage. | |
MultiStepFormBase:: |
protected | property | Review form steps switcher. | |
MultiStepFormBase:: |
public static | function |
Instantiates a new instance of this class. Overrides FormBase:: |
1 |
MultiStepFormBase:: |
public | function | Form submission for the last step. | |
MultiStepFormBase:: |
final public | function |
Overrides FormInterface:: |
|
MultiStepFormBase:: |
public | function | Form submission for back button. | |
MultiStepFormBase:: |
public | function | Form submission for next button. | |
MultiStepFormBase:: |
public | function | MultiStepFormBase constructor. | 1 |
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. | |
ReviewUserForm:: |
public | function |
Form constructor. Overrides MultiStepFormBase:: |
|
ReviewUserForm:: |
public | function |
Returns a unique string identifying the form. Overrides FormInterface:: |
|
StringTranslationTrait:: |
protected | property | The string translation service. | 4 |
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. |