Skip to content

EntitySelect

Provides a element for a entity select menu.


  • Full name: \Drupal\helper\Element\EntitySelect
  • Parent class: Select

Methods

getInfo

{@inheritdoc}

public getInfo(): mixed

processSelect

{@inheritdoc}

public static processSelect(mixed& $element, \Drupal\Core\Form\FormStateInterface $form_state, mixed& $complete_form): mixed
  • This method is static. Parameters:
Parameter Type Description
$element mixed
$form_state \Drupal\Core\Form\FormStateInterface
$complete_form mixed

setEntityOptions

Set referenceable entities as options for an element.

public static setEntityOptions(array& $element, array $settings = []): mixed
  • This method is static. Parameters:
Parameter Type Description
$element array
An element.
$settings array
An array of settings used to limit and randomize options.

Throws:

Thrown when the current user doesn't have access to the specified entity. - AccessDeniedHttpException

See Also:

  • \Drupal\system\Controller\EntityAutocompleteController