function list_test_dynamic_values_callback
An entity-bound allowed values callback.
2 string references to 'list_test_dynamic_values_callback'
- ListDynamicValuesTestCase::setUp in modules/
field/ modules/ list/ tests/ list.test - Set the default field storage backend for fields created during tests.
- ListFieldUITestCase::testDynamicListAllowedValuesText in modules/
field/ modules/ list/ tests/ list.test - List (text) : test 'allowed values function' input.
File
-
modules/
field/ modules/ list/ tests/ list_test.module, line 28
Code
function list_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_merge(array(
$entity->ftlabel,
), entity_extract_ids($entity_type, $entity)));
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.