You are here

public function FormAlter::doPopulateUserRoles in Form mode manager 8.2

Evaluate if current form do pre populate user of not.

Parameters

string $formId: The Form ID.

string $dynamicFormId: The Form ID calculated via routing entity_form parameters.

array $roles: Roles to automatically assign to new user to register.

Return value

bool True if current register form can assign roles from configuration.

1 call to FormAlter::doPopulateUserRoles()
FormAlter::formAlter in modules/form_mode_user_roles_assign/src/FormAlter.php
Automatically assign user roles of register/create routes using FMM.

File

modules/form_mode_user_roles_assign/src/FormAlter.php, line 166

Class

FormAlter
Manipulates Form Alter information.

Namespace

Drupal\form_mode_user_roles_assign

Code

public function doPopulateUserRoles($formId, $dynamicFormId, array $roles) {
  return $formId == $dynamicFormId && !empty($roles);
}