Commit 0790cd97 authored by jhodgdon's avatar jhodgdon

Issue #1326634 by xjm, NROTC_Webmaster, dellintosh, xenophyle: Fix up API docs in field module

parent 2a686840
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -25,18 +25,18 @@ ...@@ -25,18 +25,18 @@
* @param $field * @param $field
* The field structure for the operation. * The field structure for the operation.
* @param $instance * @param $instance
* The instance structure for $field on $entity's bundle. * The instance structure for $field in $entity's bundle.
* @param $langcode * @param $langcode
* The language associated to $items. * The language associated with $items.
* @param $items * @param $items
* $entity->{$field['field_name']}[$langcode], or an empty array if unset. * $entity->{$field['field_name']}[$langcode], or an empty array if unset.
* @param $errors * @param $errors
* The array of errors, keyed by field name and by value delta, that have * The array of errors, keyed by field name and by value delta, that have
* already been reported for the entity. The function should add its errors * already been reported for the entity. The function should add its errors to
* to this array. Each error is an associative array, with the following * this array. Each error is an associative array, with the following keys and
* keys and values: * values:
* - 'error': an error code (should be a string, prefixed with the module name) * - error: An error code (should be a string, prefixed with the module name).
* - 'message': the human readable message to be displayed. * - message: The human readable message to be displayed.
*/ */
function field_default_validate($entity_type, $entity, $field, $instance, $langcode, $items, &$errors) { function field_default_validate($entity_type, $entity, $field, $instance, $langcode, $items, &$errors) {
// Filter out empty values. // Filter out empty values.
...@@ -54,11 +54,24 @@ function field_default_validate($entity_type, $entity, $field, $instance, $langc ...@@ -54,11 +54,24 @@ function field_default_validate($entity_type, $entity, $field, $instance, $langc
} }
/** /**
* Default field 'insert' operation. * Inserts a default value if no $entity->$field_name entry was provided.
* *
* Insert default value if no $entity->$field_name entry was provided.
* This can happen with programmatic saves, or on form-based creation where * This can happen with programmatic saves, or on form-based creation where
* the current user doesn't have 'edit' permission for the field. * the current user doesn't have 'edit' permission for the field. This is the
* default field 'insert' operation.
*
* @param $entity_type
* The type of $entity.
* @param $entity
* The entity for the operation.
* @param $field
* The field structure for the operation.
* @param $instance
* The instance structure for $field in $entity's bundle.
* @param $langcode
* The language associated with $items.
* @param $items
* An array that this function will populate with default values.
*/ */
function field_default_insert($entity_type, $entity, $field, $instance, $langcode, &$items) { function field_default_insert($entity_type, $entity, $field, $instance, $langcode, &$items) {
// _field_invoke() populates $items with an empty array if the $entity has no // _field_invoke() populates $items with an empty array if the $entity has no
...@@ -79,20 +92,20 @@ function field_default_insert($entity_type, $entity, $field, $instance, $langcod ...@@ -79,20 +92,20 @@ function field_default_insert($entity_type, $entity, $field, $instance, $langcod
* @param $entity_type * @param $entity_type
* The type of $entity; e.g. 'node' or 'user'. * The type of $entity; e.g. 'node' or 'user'.
* @param $entities * @param $entities
* An array of entities being displayed, keyed by entity id. * An array of entities being displayed, keyed by entity ID.
* @param $field * @param $field
* The field structure for the operation. * The field structure for the operation.
* @param $instances * @param $instances
* Array of instance structures for $field for each entity, keyed by entity * Array of instance structures for $field for each entity, keyed by entity
* id. * ID.
* @param $langcode * @param $langcode
* The language associated to $items. * The language associated with $items.
* @param $items * @param $items
* Array of field values already loaded for the entities, keyed by entity id. * Array of field values already loaded for the entities, keyed by entity id.
* @param $display * @param $display
* Can be either: * Can be either:
* - the name of a view mode * - The name of a view mode
* - or an array of display settings to use for display, as found in the * - An array of display settings to use for display, as found in the
* 'display' entry of $instance definitions. * 'display' entry of $instance definitions.
*/ */
function field_default_prepare_view($entity_type, $entities, $field, $instances, $langcode, &$items, $display) { function field_default_prepare_view($entity_type, $entities, $field, $instances, $langcode, &$items, $display) {
...@@ -204,15 +217,15 @@ function field_default_view($entity_type, $entity, $field, $instance, $langcode, ...@@ -204,15 +217,15 @@ function field_default_view($entity_type, $entity, $field, $instance, $langcode,
* @param $field * @param $field
* The field structure for the operation. * The field structure for the operation.
* @param $instance * @param $instance
* The instance structure for $field on $entity's bundle. * The instance structure for $field in $entity's bundle.
* @param $langcode * @param $langcode
* The language the entity has to be translated in. * The language the entity has to be translated to.
* @param $items * @param $items
* $entity->{$field['field_name']}[$langcode], or an empty array if unset. * $entity->{$field['field_name']}[$langcode], or an empty array if unset.
* @param $source_entity * @param $source_entity
* The source entity holding the field values to be translated. * The source entity holding the field values to be translated.
* @param $source_langcode * @param $source_langcode
* The source language from which translate. * The source language from which to translate.
*/ */
function field_default_prepare_translation($entity_type, $entity, $field, $instance, $langcode, &$items, $source_entity, $source_langcode) { function field_default_prepare_translation($entity_type, $entity, $field, $instance, $langcode, &$items, $source_entity, $source_langcode) {
$field_name = $field['field_name']; $field_name = $field['field_name'];
......
...@@ -8,14 +8,15 @@ ...@@ -8,14 +8,15 @@
/** /**
* Returns HTML for an individual form element. * Returns HTML for an individual form element.
* *
* Combine multiple values into a table with drag-n-drop reordering. * Combines multiple values into a table with drag-n-drop reordering.
* TODO : convert to a template.
* *
* @param $variables * @param $variables
* An associative array containing: * An associative array containing:
* - element: A render element representing the form element. * - element: A render element representing the form element.
* *
* @ingroup themeable * @ingroup themeable
*
* @todo Convert to a template.
*/ */
function theme_field_multiple_value_form($variables) { function theme_field_multiple_value_form($variables) {
$element = $variables['element']; $element = $variables['element'];
...@@ -82,11 +83,19 @@ function theme_field_multiple_value_form($variables) { ...@@ -82,11 +83,19 @@ function theme_field_multiple_value_form($variables) {
} }
/** /**
* #after_build callback for field elements in a form. * After-build callback for field elements in a form.
*
* This stores the final location of the field within the form structure so that
* field_default_form_errors() can assign validation errors to the right form
* element.
*
* @param $element
* The form element.
* @param $form_state
* An associative array containing the current state of the form.
* *
* This stores the final location of the field within the form structure so * @return
* that field_default_form_errors() can assign validation errors to the right * The $element array that was passed in as a parameter.
* form element.
* *
* @see field_default_form_errors() * @see field_default_form_errors()
*/ */
...@@ -103,7 +112,7 @@ function field_form_element_after_build($element, &$form_state) { ...@@ -103,7 +112,7 @@ function field_form_element_after_build($element, &$form_state) {
} }
/** /**
* Submit handler for the "Add another item" button of a field form. * Form submission handler for the "Add another item" button of a field form.
* *
* This handler is run regardless of whether JS is enabled or not. It makes * This handler is run regardless of whether JS is enabled or not. It makes
* changes to the form state. If the button was clicked with JS disabled, then * changes to the form state. If the button was clicked with JS disabled, then
...@@ -129,7 +138,7 @@ function field_add_more_submit($form, &$form_state) { ...@@ -129,7 +138,7 @@ function field_add_more_submit($form, &$form_state) {
} }
/** /**
* Ajax callback in response to a new empty widget being added to the form. * Ajax callback: Responds to a new empty widget being added to the form.
* *
* This returns the new page content to replace the page content made obsolete * This returns the new page content to replace the page content made obsolete
* by the form submission. * by the form submission.
...@@ -174,12 +183,12 @@ function field_add_more_js($form, $form_state) { ...@@ -174,12 +183,12 @@ function field_add_more_js($form, $form_state) {
* *
* @return * @return
* An array with the following key/data pairs: * An array with the following key/data pairs:
* - field: the field definition array, * - field: The field definition array.
* - instance: the field instance definition array, * - instance: The field instance definition array.
* - items_count: the number of widgets to display for the field, * - items_count: The number of widgets to display for the field.
* - array_parents: the location of the field's widgets within the $form * - array_parents: The location of the field's widgets within the $form
* structure. This entry is populated at '#after_build' time. * structure. This entry is populated at '#after_build' time.
* - errors: the array of field validation errors reported on the field. This * - errors: The array of field validation errors reported on the field. This
* entry is populated at field_attach_form_validate() time. * entry is populated at field_attach_form_validate() time.
* *
* @see field_form_set_state() * @see field_form_set_state()
...@@ -213,6 +222,16 @@ function field_form_set_state($parents, $field_name, $langcode, &$form_state, $f ...@@ -213,6 +222,16 @@ function field_form_set_state($parents, $field_name, $langcode, &$form_state, $f
/** /**
* Returns the location of processing information within $form_state. * Returns the location of processing information within $form_state.
*
* @param $parents
* The array of #parents where the field lives in the form.
* @param $field_name
* The field name.
* @param $langcode
* The language in which the field values are entered.
*
* @return
* The location of processing information within $form_state.
*/ */
function _field_form_state_parents($parents, $field_name, $langcode) { function _field_form_state_parents($parents, $field_name, $langcode) {
// To ensure backwards compatibility on regular entity forms for widgets that // To ensure backwards compatibility on regular entity forms for widgets that
...@@ -238,7 +257,7 @@ function _field_form_state_parents($parents, $field_name, $langcode) { ...@@ -238,7 +257,7 @@ function _field_form_state_parents($parents, $field_name, $langcode) {
/** /**
* Retrieves the field definition for a widget's helper callbacks. * Retrieves the field definition for a widget's helper callbacks.
* *
* Widgets helper element callbacks (such as #process, #element_validate, * Widget helper element callbacks (such as #process, #element_validate,
* #value_callback, ...) should use field_widget_field() and * #value_callback, ...) should use field_widget_field() and
* field_widget_instance() instead of field_info_field() and * field_widget_instance() instead of field_info_field() and
* field_info_instance() when they need to access field or instance properties. * field_info_instance() when they need to access field or instance properties.
......
...@@ -10,11 +10,11 @@ ...@@ -10,11 +10,11 @@
/** /**
* @defgroup field_info Field Info API * @defgroup field_info Field Info API
* @{ * @{
* Obtain information about Field API configuration. * Obtains information about Field API configuration.
* *
* The Field Info API exposes information about field types, fields, * The Field Info API exposes information about field types, fields, instances,
* instances, bundles, widget types, display formatters, behaviors, * bundles, widget types, display formatters, behaviors, and settings defined by
* and settings defined by or with the Field API. * or with the Field API.
* *
* See @link field Field API @endlink for information about the other parts of * See @link field Field API @endlink for information about the other parts of
* the Field API. * the Field API.
...@@ -23,9 +23,8 @@ ...@@ -23,9 +23,8 @@
/** /**
* Clears the field info cache without clearing the field data cache. * Clears the field info cache without clearing the field data cache.
* *
* This is useful when deleted fields or instances are purged. We * This is useful when deleted fields or instances are purged. We need to remove
* need to remove the purged records, but no actual field data items * the purged records, but no actual field data items are affected.
* are affected.
*/ */
function field_info_cache_clear() { function field_info_cache_clear() {
drupal_static_reset('field_view_mode_settings'); drupal_static_reset('field_view_mode_settings');
...@@ -145,7 +144,7 @@ function _field_info_collate_types() { ...@@ -145,7 +144,7 @@ function _field_info_collate_types() {
} }
/** /**
* Clear collated information on field and widget types and related structures. * Clears collated information on field and widget types and related structures.
*/ */
function _field_info_collate_types_reset() { function _field_info_collate_types_reset() {
drupal_static_reset('_field_info_collate_types'); drupal_static_reset('_field_info_collate_types');
...@@ -158,15 +157,15 @@ function _field_info_collate_types_reset() { ...@@ -158,15 +157,15 @@ function _field_info_collate_types_reset() {
* *
* @return * @return
* An associative array containing: * An associative array containing:
* - fields: Array of existing fields, keyed by field ID. This element * - fields: Array of existing fields, keyed by field ID. This element lists
* lists deleted and non-deleted fields, but not inactive ones. * deleted and non-deleted fields, but not inactive ones. Each field has an
* Each field has an additional element, 'bundles', which is an array * additional element, 'bundles', which is an array of all non-deleted
* of all non-deleted instances of that field. * instances of that field.
* - field_ids: Array of field IDs, keyed by field name. This element * - field_ids: Array of field IDs, keyed by field name. This element only
* only lists non-deleted, active fields. * lists non-deleted, active fields.
* - instances: Array of existing instances, keyed by entity type, bundle * - instances: Array of existing instances, keyed by entity type, bundle name
* name and field name. This element only lists non-deleted instances * and field name. This element only lists non-deleted instances whose field
* whose field is active. * is active.
* *
* @see _field_info_collate_fields_reset() * @see _field_info_collate_fields_reset()
*/ */
...@@ -240,7 +239,7 @@ function _field_info_collate_fields() { ...@@ -240,7 +239,7 @@ function _field_info_collate_fields() {
} }
/** /**
* Clear collated information on existing fields and instances. * Clears collated information on existing fields and instances.
*/ */
function _field_info_collate_fields_reset() { function _field_info_collate_fields_reset() {
drupal_static_reset('_field_info_collate_fields'); drupal_static_reset('_field_info_collate_fields');
...@@ -255,6 +254,9 @@ function _field_info_collate_fields_reset() { ...@@ -255,6 +254,9 @@ function _field_info_collate_fields_reset() {
* *
* @param $field * @param $field
* The raw field structure as read from the database. * The raw field structure as read from the database.
*
* @return
* The field array with storage and settings data added.
*/ */
function _field_info_prepare_field($field) { function _field_info_prepare_field($field) {
// Make sure all expected field settings are present. // Make sure all expected field settings are present.
...@@ -277,7 +279,7 @@ function _field_info_prepare_field($field) { ...@@ -277,7 +279,7 @@ function _field_info_prepare_field($field) {
* *
* Since the instance was last saved or updated, a number of things might have * Since the instance was last saved or updated, a number of things might have
* changed: widgets or formatters disabled, new settings expected, new view * changed: widgets or formatters disabled, new settings expected, new view
* modes added... * modes added, etc.
* *
* @param $instance * @param $instance
* The raw instance structure as read from the database. * The raw instance structure as read from the database.
...@@ -327,8 +329,10 @@ function _field_info_prepare_instance($instance, $field) { ...@@ -327,8 +329,10 @@ function _field_info_prepare_instance($instance, $field) {
* @param $field * @param $field
* The field structure for the instance. * The field structure for the instance.
* @param $display * @param $display
* Display specifications as found in * Display specifications as found in $instance['display']['some_view_mode'].
* $instance['display']['some_view_mode']. *
* @return
* The modified $display array.
*/ */
function _field_info_prepare_instance_display($field, $display) { function _field_info_prepare_instance_display($field, $display) {
$field_type = field_info_field_types($field['type']); $field_type = field_info_field_types($field['type']);
...@@ -364,6 +368,9 @@ function _field_info_prepare_instance_display($field, $display) { ...@@ -364,6 +368,9 @@ function _field_info_prepare_instance_display($field, $display) {
* The entity type. * The entity type.
* @param $bundle * @param $bundle
* The bundle name. * The bundle name.
*
* @return
* An array of data about extra fields.
*/ */
function _field_info_prepare_extra_fields($extra_fields, $entity_type, $bundle) { function _field_info_prepare_extra_fields($extra_fields, $entity_type, $bundle) {
$entity_type_info = entity_get_info($entity_type); $entity_type_info = entity_get_info($entity_type);
...@@ -408,8 +415,8 @@ function _field_info_prepare_extra_fields($extra_fields, $entity_type, $bundle) ...@@ -408,8 +415,8 @@ function _field_info_prepare_extra_fields($extra_fields, $entity_type, $bundle)
* Determines the behavior of a widget with respect to an operation. * Determines the behavior of a widget with respect to an operation.
* *
* @param $op * @param $op
* The name of the operation. Currently supported: 'default value', * The name of the operation. Currently supported: 'default value', 'multiple
* 'multiple values'. * values'.
* @param $instance * @param $instance
* The field instance array. * The field instance array.
* *
...@@ -428,8 +435,7 @@ function field_behaviors_widget($op, $instance) { ...@@ -428,8 +435,7 @@ function field_behaviors_widget($op, $instance) {
* Returns information about field types from hook_field_info(). * Returns information about field types from hook_field_info().
* *
* @param $field_type * @param $field_type
* (optional) A field type name. If omitted, all field types will be * (optional) A field type name. If omitted, all field types will be returned.
* returned.
* *
* @return * @return
* Either a field type description, as provided by hook_field_info(), or an * Either a field type description, as provided by hook_field_info(), or an
...@@ -502,8 +508,8 @@ function field_info_formatter_types($formatter_type = NULL) { ...@@ -502,8 +508,8 @@ function field_info_formatter_types($formatter_type = NULL) {
* *
* @return * @return
* Either a storage type description, as provided by * Either a storage type description, as provided by
* hook_field_storage_info(), or an array of all existing storage types, * hook_field_storage_info(), or an array of all existing storage types, keyed
* keyed by storage type name. * by storage type name.
*/ */
function field_info_storage_types($storage_type = NULL) { function field_info_storage_types($storage_type = NULL) {
$info = _field_info_collate_types(); $info = _field_info_collate_types();
...@@ -525,9 +531,9 @@ function field_info_storage_types($storage_type = NULL) { ...@@ -525,9 +531,9 @@ function field_info_storage_types($storage_type = NULL) {
* The type of entity; e.g. 'node' or 'user'. * The type of entity; e.g. 'node' or 'user'.
* *
* @return * @return
* An array of bundles for the $entity_type keyed by bundle name, * An array of bundles for the $entity_type keyed by bundle name, or, if no
* or, if no $entity_type was provided, the array of all existing bundles, * $entity_type was provided, the array of all existing bundles, keyed by
* keyed by entity type. * entity type.
*/ */
function field_info_bundles($entity_type = NULL) { function field_info_bundles($entity_type = NULL) {
$info = entity_get_info(); $info = entity_get_info();
...@@ -549,7 +555,7 @@ function field_info_bundles($entity_type = NULL) { ...@@ -549,7 +555,7 @@ function field_info_bundles($entity_type = NULL) {
* @return * @return
* An array of field definitions, keyed by field name. Each field has an * An array of field definitions, keyed by field name. Each field has an
* additional property, 'bundles', which is an array of all the bundles to * additional property, 'bundles', which is an array of all the bundles to
* which this field belongs keyed by entity type. * which this field belongs, keyed by entity type.
*/ */
function field_info_fields() { function field_info_fields() {
$fields = array(); $fields = array();
...@@ -590,13 +596,13 @@ function field_info_field($field_name) { ...@@ -590,13 +596,13 @@ function field_info_field($field_name) {
* Returns data about an individual field, given a field ID. * Returns data about an individual field, given a field ID.
* *
* @param $field_id * @param $field_id
* The id of the field to retrieve. $field_id can refer to a * The ID of the field to retrieve. $field_id can refer to a deleted field,
* deleted field, but not an inactive one. * but not an inactive one.
* *
* @return * @return
* The field array, as returned by field_read_fields(), with an * The field array, as returned by field_read_fields(), with an additional
* additional element 'bundles', whose value is an array of all the bundles * element 'bundles', whose value is an array of all the bundles this field
* this field belongs to. * belongs to.
* *
* @see field_info_field() * @see field_info_field()
*/ */
...@@ -637,8 +643,8 @@ function field_info_field_by_ids() { ...@@ -637,8 +643,8 @@ function field_info_field_by_ids() {
* @return * @return
* If $entity_type is not set, return all instances keyed by entity type and * If $entity_type is not set, return all instances keyed by entity type and
* bundle name. If $entity_type is set, return all instances for that entity * bundle name. If $entity_type is set, return all instances for that entity
* type, keyed by bundle name. If $entity_type and $bundle_name are set, return * type, keyed by bundle name. If $entity_type and $bundle_name are set,
* all instances for that bundle. * return all instances for that bundle.
*/ */
function field_info_instances($entity_type = NULL, $bundle_name = NULL) { function field_info_instances($entity_type = NULL, $bundle_name = NULL) {
$info = _field_info_collate_fields(); $info = _field_info_collate_fields();
...@@ -722,8 +728,8 @@ function field_info_instance($entity_type, $field_name, $bundle_name) { ...@@ -722,8 +728,8 @@ function field_info_instance($entity_type, $field_name, $bundle_name) {
* @param $bundle * @param $bundle
* The bundle name. * The bundle name.
* @param $context * @param $context
* The context for which the list of pseudo-fields is requested. Either * The context for which the list of pseudo-fields is requested. Either 'form'
* 'form' or 'display'. * or 'display'.
* *
* @return * @return
* The array of pseudo-field elements in the bundle. * The array of pseudo-field elements in the bundle.
...@@ -749,6 +755,7 @@ function field_info_extra_fields($entity_type, $bundle, $context) { ...@@ -749,6 +755,7 @@ function field_info_extra_fields($entity_type, $bundle, $context) {
* @param $context * @param $context
* The context for which the maximum weight is requested. Either 'form', or * The context for which the maximum weight is requested. Either 'form', or
* the name of a view mode. * the name of a view mode.
*
* @return * @return
* The maximum weight of the entity's components, or NULL if no components * The maximum weight of the entity's components, or NULL if no components
* were found. * were found.
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
/** /**
* @file * @file
* Install, update and uninstall functions for the field module. * Install, update, and uninstall functions for the Field module.
*/ */
/** /**
...@@ -167,7 +167,7 @@ function field_schema() { ...@@ -167,7 +167,7 @@ function field_schema() {
} }
/** /**
* Utility function: create a field by writing directly to the database. * Creates a field by writing directly to the database.
* *
* @ingroup update-api-7.x-to-8.x * @ingroup update-api-7.x-to-8.x
*/ */
...@@ -237,7 +237,7 @@ function _update_7000_field_create_field(&$field) { ...@@ -237,7 +237,7 @@ function _update_7000_field_create_field(&$field) {
} }
/** /**
* Utility function: delete a field stored in SQL storage directly from the database. * Deletes a field stored in SQL storage directly from the database.
* *
* To protect user data, this function can only be used to delete fields once * To protect user data, this function can only be used to delete fields once
* all information it stored is gone. Delete all data from the * all information it stored is gone. Delete all data from the
...@@ -272,9 +272,9 @@ function _update_7000_field_delete_field($field_name) { ...@@ -272,9 +272,9 @@ function _update_7000_field_delete_field($field_name) {
/** /**
* Utility function: delete an instance and all its data of a field stored in SQL Storage. * Deletes an instance and all its data of a field stored in SQL Storage.
* *
* BEWARE: this function deletes user data from the field storage tables. * BEWARE: This function deletes user data from the field storage tables.
* *
* @ingroup update-api-7.x-to-8.x * @ingroup update-api-7.x-to-8.x
*/ */
...@@ -298,9 +298,9 @@ function _update_7000_field_delete_instance($field_name, $entity_type, $bundle) ...@@ -298,9 +298,9 @@ function _update_7000_field_delete_instance($field_name, $entity_type, $bundle)
} }
/** /**
* Utility function: fetch all the field definitions from the database. * Fetches all of the field definitions from the database.
* *
* Warning: unlike the field_read_fields() API function, this function returns * Warning: Unlike the field_read_fields() API function, this function returns
* all fields by default, including deleted and inactive fields, unless * all fields by default, including deleted and inactive fields, unless
* specified otherwise in the $conditions parameter. * specified otherwise in the $conditions parameter.
* *
...@@ -344,7 +344,7 @@ function _update_7000_field_read_fields(array $conditions = array(), $key = 'id' ...@@ -344,7 +344,7 @@ function _update_7000_field_read_fields(array $conditions = array(), $key = 'id'
} }
/** /**
* Utility function: write a field instance directly to the database. * Writes a field instance directly to the database.
* *
* @ingroup update-api-7.x-to-8.x * @ingroup update-api-7.x-to-8.x
*/ */
......
This diff is collapsed.
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
/** /**
* @defgroup field_language Field Language API * @defgroup field_language Field Language API
* @{ * @{
* Handling of multilingual fields. * Handles multilingual fields.
* *
* Fields natively implement multilingual support, and all fields use the * Fields natively implement multilingual support, and all fields use the
* following structure: * following structure:
...@@ -32,10 +32,16 @@ ...@@ -32,10 +32,16 @@
* module registering itself via hook_entity_info() to handle field * module registering itself via hook_entity_info() to handle field
* translations. * translations.
* *
* By default, _field_invoke() and _field_invoke_multiple() are processing a * By default, _field_invoke() and _field_invoke_multiple() are processing a
* field in all available languages, unless they are given a language code * field in all available languages, unless they are given a language code
* suggestion. Based on that suggestion, _field_language_suggestion() determines * suggestion. Based on that suggestion, _field_language_suggestion() determines
* the languages to act on. * the languages to act on.
* By default, _field_invoke() and _field_invoke_multiple() process a field in
* all available languages, unless they are given a language code suggestion.
* Based on that suggestion, _field_language_suggestion() determines the
* languages to act on.
* *
* Most field_attach_*() functions act on all available language codes, except * Most field_attach_*() functions act on all available language codes, except
* for the following: * for the following:
...@@ -142,8 +148,7 @@ function field_available_languages($entity_type, $field) { ...@@ -142,8 +148,7 @@ function field_available_languages($entity_type, $field) {
} }
/** /**
* Process the given language code suggestion based on the available language * Process the language code suggestion based on the available language codes.
* codes.
* *
* If a non-empty language code suggestion is provided it must appear among the * If a non-empty language code suggestion is provided it must appear among the
* available language codes, otherwise it will be ignored. * available language codes, otherwise it will be ignored.
...@@ -207,8 +212,8 @@ function field_is_translatable($entity_type, $field) { ...@@ -207,8 +212,8 @@ function field_is_translatable($entity_type, $field) {