summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorxjm2015-04-19 14:48:37 +0200
committerxjm2015-04-19 14:48:37 +0200
commit80f8335ca80435785df697a232434666169fc40a (patch)
treed5fd6df7e69dc69132c9a21fd84837cd2cfe8072
parente6589042e5b39ae7593ee10ec40971515ba7c895 (diff)
Issue #2146045 by D Szkiba, joshi.rohit100, tyler.frankenstein, er.pushpinderrana, dajjen, jhodgdon, joachim: Document Field API allowed_values_function callback
-rw-r--r--core/modules/options/options.api.php6
-rw-r--r--core/modules/options/tests/options_test/options_test.module4
2 files changed, 6 insertions, 4 deletions
diff --git a/core/modules/options/options.api.php b/core/modules/options/options.api.php
index 6907641..f17f102 100644
--- a/core/modules/options/options.api.php
+++ b/core/modules/options/options.api.php
@@ -26,6 +26,7 @@ use Drupal\Core\Field\FieldStorageDefinitionInterface;
* - entity: The entity object the field is attached to
* (\Drupal\Core\Entity\EntityInterface).
*
+ * @ingroup hooks
* @see hook_options_list()
*/
function hook_options_list_alter(array &$options, array $context) {
@@ -37,12 +38,12 @@ function hook_options_list_alter(array &$options, array $context) {
}
/**
- * Provides the allowed values for a 'list_*' field.
+ * Provide the allowed values for a 'list_*' field.
*
* Callback for options_allowed_values().
*
* 'list_*' fields can specify a callback to define the set of their allowed
- * values using the 'allowed_values_callback' storage setting.
+ * values using the 'allowed_values_function' storage setting.
*
* That function will be called:
* - either in the context of a specific entity, which is then provided as the
@@ -74,6 +75,7 @@ function hook_options_list_alter(array &$options, array $context) {
* any context so that other code (e.g. Views filters) can support the allowed
* values for all possible entities and bundles.
*
+ * @ingroup callbacks
* @see options_allowed_values()
* @see options_test_allowed_values_callback()
* @see options_test_dynamic_values_callback()
diff --git a/core/modules/options/tests/options_test/options_test.module b/core/modules/options/tests/options_test/options_test.module
index 2d719d3..59b8e1c 100644
--- a/core/modules/options/tests/options_test/options_test.module
+++ b/core/modules/options/tests/options_test/options_test.module
@@ -9,7 +9,7 @@ use Drupal\Core\Entity\FieldableEntityInterface;
use Drupal\Core\Field\FieldStorageDefinitionInterface;
/**
- * Allowed values callback.
+ * Implements callback_allowed_values_function().
*
* @see options_allowed_values().
*/
@@ -31,7 +31,7 @@ function options_test_allowed_values_callback(FieldStorageDefinitionInterface $d
}
/**
- * An entity-bound allowed values callback.
+ * Implements callback_allowed_values_function().
*
* @todo This function violates the recommendation in options_allowed_values()
* to return a list of all possible values in any context when $items is