class UserCancelMethodsConstraint

Constraint for the user cancel method.

Attributes

#[Constraint(id: 'UserCancelMethod', label: new TranslatableMarkup('UserCancelMethod', [], [ 'context' => 'Validation', ]))]

Hierarchy

Expanded class hierarchy of UserCancelMethodsConstraint

File

core/modules/user/src/Plugin/Validation/Constraint/UserCancelMethodsConstraint.php, line 16

Namespace

Drupal\user\Plugin\Validation\Constraint
View source
class UserCancelMethodsConstraint implements ContainerFactoryPluginInterface {
  
  /**
   * {@inheritdoc}
   */
  public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) : Choice {
    $configuration['choices'] = array_keys(user_cancel_methods()['#options']);
    return new Choice($configuration);
  }

}

Members

Title Sort descending Modifiers Object type Summary Overriden Title
UserCancelMethodsConstraint::create public static function Creates an instance of the plugin. Overrides ContainerFactoryPluginInterface::create

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.