AccountForm::__construct

public AccountForm::__construct(EntityManagerInterface $entity_manager, LanguageManagerInterface $language_manager, QueryFactory $entity_query) Constructs a new EntityForm object. Parameters \Drupal\Core\Entity\EntityManagerInterface $entity_manager: The entity manager. \Drupal\Core\Language\LanguageManagerInterface $language_manager: The language manager. \Drupal\Core\Entity\Query\QueryFactory $entity_query: The entity query factory. Overrides ContentEntityForm::__construct File core/modules/

AccountForm::syncUserLangcode

public AccountForm::syncUserLangcode($entity_type_id, UserInterface $user, array &$form, FormStateInterface &$form_state) Synchronizes preferred language and entity language. Parameters string $entity_type_id: The entity type identifier. \Drupal\user\UserInterface $user: The entity updated with the submitted values. array $form: The complete form array. \Drupal\Core\Form\FormStateInterface $form_state: The current state of the form. File core/modules/user/src/AccountForm.php, line 302

AccountForm::submitForm

public AccountForm::submitForm(array &$form, FormStateInterface $form_state) This is the default entity object builder function. It is called before any other submit handler to build the new entity object to be used by the following submit handlers. At this point of the form workflow the entity is validated and the form state can be updated, this way the subsequently invoked handlers can retrieve a regular entity object to act on. Generally this method should not be overridden unless the e

AccountForm::getEditedFieldNames

protected AccountForm::getEditedFieldNames(FormStateInterface $form_state) Gets the names of all fields edited in the form. If the entity form customly adds some fields to the form (i.e. without using the form display), it needs to add its fields here and override flagViolations() for displaying the violations. Parameters \Drupal\Core\Form\FormStateInterface $form_state: The current state of the form. Return value string[] An array of field names. Overrides ContentEntityForm::getEditedFieldNa

AccountForm::form

public AccountForm::form(array $form, FormStateInterface $form_state) Gets the actual form array to be built. Overrides ContentEntityForm::form See also \Drupal\Core\Entity\EntityForm::processForm() \Drupal\Core\Entity\EntityForm::afterBuild() File core/modules/user/src/AccountForm.php, line 67 Class AccountForm Form controller for the user account forms. Namespace Drupal\user Code public function form(array $form, FormStateInterface $form_state) { /** @var \Drupal\user\UserInterfac

AccountForm::flagViolations

protected AccountForm::flagViolations(EntityConstraintViolationListInterface $violations, array $form, FormStateInterface $form_state) Flags violations for the current form. If the entity form customly adds some fields to the form (i.e. without using the form display), it needs to add its fields to array returned by getEditedFieldNames() and overwrite this method in order to show any violations for those fields; e.g.: foreach ($violations->getByField('name') as $violation) { $form_state-&g

AccountForm::create

public static AccountForm::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. Parameters \Symfony\Component\DependencyInjection\ContainerInterface $container: The service cont

AccountForm::buildEntity

public AccountForm::buildEntity(array $form, FormStateInterface $form_state) Builds an updated entity object based upon the submitted form values. For building the updated entity object the form's entity is cloned and the submitted form values are copied to entity properties. The form's entity remains unchanged. Parameters array $form: A nested array form elements comprising the form. \Drupal\Core\Form\FormStateInterface $form_state: The current state of the form. Return value \Drupal\Core\En

AccountForm::alterPreferredLangcodeDescription

public AccountForm::alterPreferredLangcodeDescription(array $element) Alters the preferred language widget description. Parameters array $element: The preferred language form element. Return value array The preferred language form element. File core/modules/user/src/AccountForm.php, line 282 Class AccountForm Form controller for the user account forms. Namespace Drupal\user Code public function alterPreferredLangcodeDescription(array $element) { // Only add to the description if th

AccountForm::$languageManager

The language manager. Type: \Drupal\Core\Language\LanguageManagerInterface File core/modules/user/src/AccountForm.php, line 28 Class AccountForm Form controller for the user account forms. Namespace Drupal\user Code protected $languageManager;