diff --git a/core/modules/field/field.api.php b/core/modules/field/field.api.php index d6bc578..e37afa3 100644 --- a/core/modules/field/field.api.php +++ b/core/modules/field/field.api.php @@ -300,3 +300,26 @@ function hook_field_purge_instance($instance) { /** * @} End of "addtogroup hooks". */ + +/** + * Specifies the allowed values list for a field. + * + * @param FieldDefinitionInterface $field_definition + * The field definition. + * + * @param EntityInterface $entity + * The entity object. + * + * @return + * An associative array to use with keys and values to use with the key|label + * a field's allowed value list. + * + * @ingroup callbacks + */ +function callback_allowed_values_function(FieldDefinitionInterface $field_definition, EntityInterface $entity) { + $values = array( + 0 => 'no', + 1 => 'yes' + ); + return $values; +}