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/field/modules/options/lib/Drupal/options/Tests/OptionsDynamicValuesTest.php
Set the default field storage backend for fields created during tests.

File

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

Code

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

  // We need the values of the entity as keys.
  return drupal_map_assoc(array(
    $entity->ftlabel,
    $entity
      ->id(),
    $entity
      ->getRevisionId(),
    $entity
      ->bundle(),
  ));
}