final class Hooks implements ContainerInjectionInterface

Implements module hooks.

Traits

StringTranslationTrait

Methods

__construct(TranslationInterface $stringTranslation, ModuleHandlerInterface $moduleHandler, AuthmapInterface $authMap, FilterPluginManager $filterManager, ConfigFactoryInterface $configFactory)

Constructs a new Hooks object.

static Hooks
create(ContainerInterface $container)

{@inheritDoc}

string|Stringable|array|null
help(string $route_name, RouteMatchInterface $route_match)

Implements hook_help().

array
theme($existing, $type, $theme, $path)

Implements hook_theme().

void
validationConstraintAlter(array $definitions)

Implements hook_validation_constraint_alter().

void
userFormAlter(array $form, FormStateInterface $form_state, $form_id)

Implements hook_form_BASE_FORM_ID_alter().

Details

at line 31
__construct(TranslationInterface $stringTranslation, ModuleHandlerInterface $moduleHandler, AuthmapInterface $authMap, FilterPluginManager $filterManager, ConfigFactoryInterface $configFactory)

Constructs a new Hooks object.

Parameters

TranslationInterface $stringTranslation
ModuleHandlerInterface $moduleHandler
AuthmapInterface $authMap
FilterPluginManager $filterManager
ConfigFactoryInterface $configFactory

at line 44
static Hooks create(ContainerInterface $container)

{@inheritDoc}

Parameters

ContainerInterface $container

Return Value

Hooks

at line 57
string|Stringable|array|null help(string $route_name, RouteMatchInterface $route_match)

Implements hook_help().

Parameters

string $route_name
RouteMatchInterface $route_match

Return Value

string|Stringable|array|null

at line 78
array theme($existing, $type, $theme, $path)

Implements hook_theme().

Parameters

$existing
$type
$theme
$path

Return Value

array

at line 93
void validationConstraintAlter(array $definitions)

Implements hook_validation_constraint_alter().

Replace core's ProtectedUserFieldConstraint with a decorated version that skips the validation if a user was provisioned by BankID.

Parameters

array $definitions

Return Value

void

at line 106
void userFormAlter(array $form, FormStateInterface $form_state, $form_id)

Implements hook_form_BASE_FORM_ID_alter().

Hide passwords fields on the user edit form if the user was provisioned via BankID as they don't have a Drupal password.

Add setting to disable this.

Parameters

array $form
FormStateInterface $form_state
$form_id

Return Value

void