function options_test_dynamic_values_callback

An entity-bound allowed values callback.

1 string reference to 'options_test_dynamic_values_callback'
OptionsDynamicValuesTest::setUp in drupal/core/modules/options/lib/Drupal/options/Tests/OptionsDynamicValuesTest.php
Sets up a Drupal site for running functional and integration tests.

File

drupal/core/modules/options/tests/options_test.module, line 30
Helper module for the List module tests.

Code

function options_test_dynamic_values_callback($field, $instance, EntityInterface $entity, &$cacheable) {
  $cacheable = FALSE;

  // We need the values of the entity as keys.
  $uri = $entity
    ->uri();
  return drupal_map_assoc(array(
    $entity
      ->label(),
    $uri['path'],
    $entity
      ->uuid(),
    $entity
      ->bundle(),
  ));
}