Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
drupal-3443205
Manage
Activity
Members
Labels
Plan
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Issue forks
drupal-3443205
Commits
d5685e89
Commit
d5685e89
authored
13 years ago
by
Jennifer Hodgdon
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#1436406
by scorchio, kid_icarus: Fix list formatting in Field API topic docs
parent
f48225b0
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
core/modules/field/field.module
+125
-155
125 additions, 155 deletions
core/modules/field/field.module
with
125 additions
and
155 deletions
core/modules/field/field.module
+
125
−
155
View file @
d5685e89
...
@@ -60,166 +60,136 @@ class FieldException extends Exception {}
...
@@ -60,166 +60,136 @@ class FieldException extends Exception {}
* Field definitions are represented as an array of key/value pairs.
* Field definitions are represented as an array of key/value pairs.
*
*
* array $field:
* array $field:
* - id (integer, read-only)
* - id (integer, read-only): The primary identifier of the field. It is
* The primary identifier of the field. It is assigned automatically
* assigned automatically by field_create_field().
* by field_create_field().
* - field_name (string): The name of the field. Each field name is unique
* - field_name (string)
* within Field API. When a field is attached to an entity, the field's data
* The name of the field. Each field name is unique within Field API.
* is stored in $entity->$field_name. Maximum length is 32 characters.
* When a field is attached to an entity, the field's data is stored
* - type (string): The type of the field, such as 'text' or 'image'. Field
* in $entity->$field_name. Maximum length is 32 characters.
* types are defined by modules that implement hook_field_info().
* - type (string)
* - entity_types (array): The array of entity types that can hold instances
* The type of the field, such as 'text' or 'image'. Field types
* of this field. If empty or not specified, the field can have instances
* are defined by modules that implement hook_field_info().
* in any entity type.
* - entity_types (array)
* - cardinality (integer): The number of values the field can hold. Legal
* The array of entity types that can hold instances of this field. If
* values are any positive integer or FIELD_CARDINALITY_UNLIMITED.
* empty or not specified, the field can have instances in any entity type.
* - translatable (integer): Whether the field is translatable.
* - cardinality (integer)
* - locked (integer): Whether or not the field is available for editing. If
* The number of values the field can hold. Legal values are any
* TRUE, users can't change field settings or create new instances of the
* positive integer or FIELD_CARDINALITY_UNLIMITED.
* field in the UI. Defaults to FALSE.
* - translatable (integer)
* - module (string, read-only): The name of the module that implements the
* Whether the field is translatable.
* field type.
* - locked (integer)
* - active (integer, read-only): TRUE if the module that implements the field
* Whether or not the field is available for editing. If TRUE, users can't
* type is currently enabled, FALSE otherwise.
* change field settings or create new instances of the field in the UI.
* - deleted (integer, read-only): TRUE if this field has been deleted, FALSE
* Defaults to FALSE.
* otherwise. Deleted fields are ignored by the Field Attach API. This
* - module (string, read-only)
* property exists because fields can be marked for deletion but only
* The name of the module that implements the field type.
* actually destroyed by a separate garbage-collection process.
* - active (integer, read-only)
* - columns (array, read-only): An array of the Field API columns used to
* TRUE if the module that implements the field type is currently
* store each value of this field. The column list may depend on field
* enabled, FALSE otherwise.
* settings; it is not constant per field type. Field API column
* - deleted (integer, read-only)
* specifications are exactly like Schema API column specifications but,
* TRUE if this field has been deleted, FALSE otherwise. Deleted
* depending on the field storage module in use, the name of the column may
* fields are ignored by the Field Attach API. This property exists
* not represent an actual column in an SQL database.
* because fields can be marked for deletion but only actually
* - indexes (array): An array of indexes on data columns, using the same
* destroyed by a separate garbage-collection process.
* definition format as Schema API index specifications. Only columns that
* - columns (array, read-only).
* appear in the 'columns' setting are allowed. Note that field types can
* An array of the Field API columns used to store each value of
* specify default indexes, which can be modified or added to when
* this field. The column list may depend on field settings; it is
* creating a field.
* not constant per field type. Field API column specifications are
* exactly like Schema API column specifications but, depending on
* the field storage module in use, the name of the column may not
* represent an actual column in an SQL database.
* - indexes (array).
* An array of indexes on data columns, using the same definition format
* as Schema API index specifications. Only columns that appear in the
* 'columns' setting are allowed. Note that field types can specify
* default indexes, which can be modified or added to when
* creating a field.
* - foreign keys: (optional) An associative array of relations, using the same
* - foreign keys: (optional) An associative array of relations, using the same
* structure as the 'foreign keys' definition of hook_schema(). Note, however,
* structure as the 'foreign keys' definition of hook_schema(). Note,
* that the field data is not necessarily stored in SQL. Also, the possible
* however, that the field data is not necessarily stored in SQL. Also, the
* usage is limited, as you cannot specify another field as related, only
* possible usage is limited, as you cannot specify another field as
* existing SQL tables, such as filter formats.
* related, only existing SQL tables, such as filter formats.
* - settings (array)
* - settings (array): A sub-array of key/value pairs of field-type-specific
* A sub-array of key/value pairs of field-type-specific settings. Each
* settings. Each field type module defines and documents its own field
* field type module defines and documents its own field settings.
* settings.
* - storage (array)
* - storage (array): A sub-array of key/value pairs identifying the storage
* A sub-array of key/value pairs identifying the storage backend to use for
* backend to use for the for the field:
* the for the field.
* - type (string): The storage backend used by the field. Storage backends
* - type (string)
* are defined by modules that implement hook_field_storage_info().
* The storage backend used by the field. Storage backends are defined
* - module (string, read-only): The name of the module that implements the
* by modules that implement hook_field_storage_info().
* storage backend.
* - module (string, read-only)
* - active (integer, read-only): TRUE if the module that implements the
* The name of the module that implements the storage backend.
* storage backend is currently enabled, FALSE otherwise.
* - active (integer, read-only)
* - settings (array): A sub-array of key/value pairs of settings. Each
* TRUE if the module that implements the storage backend is currently
* storage backend defines and documents its own settings.
* enabled, FALSE otherwise.
* - settings (array)
* A sub-array of key/value pairs of settings. Each storage backend
* defines and documents its own settings.
*
*
* Field instance definitions are represented as an array of key/value pairs.
* Field instance definitions are represented as an array of key/value pairs.
*
*
* array $instance:
* array $instance:
* - id (integer, read-only)
* - id (integer, read-only): The primary identifier of this field instance.
* The primary identifier of this field instance. It is assigned
* It is assigned automatically by field_create_instance().
* automatically by field_create_instance().
* - field_id (integer, read-only): The foreign key of the field attached to
* - field_id (integer, read-only)
* the bundle by this instance. It is populated automatically by
* The foreign key of the field attached to the bundle by this instance.
* field_create_instance().
* It is populated automatically by field_create_instance().
* - field_name (string): The name of the field attached to the bundle by this
* - field_name (string)
* instance.
* The name of the field attached to the bundle by this instance.
* - entity_type (string): The name of the entity type the instance is attached
* - entity_type (string)
* to.
* The name of the entity type the instance is attached to.
* - bundle (string): The name of the bundle that the field is attached to.
* - bundle (string)
* - label (string): A human-readable label for the field when used with this
* The name of the bundle that the field is attached to.
* bundle. For example, the label will be the title of Form API elements
* - label (string)
* for this instance.
* A human-readable label for the field when used with this
* - description (string): A human-readable description for the field when
* bundle. For example, the label will be the title of Form API
* used with this bundle. For example, the description will be the help
* elements for this instance.
* text of Form API elements for this instance.
* - description (string)
* - required (integer): TRUE if a value for this field is required when used
* A human-readable description for the field when used with this
* with this bundle, FALSE otherwise. Currently, required-ness is only
* bundle. For example, the description will be the help text of
* enforced during Form API operations, not by field_attach_load(),
* Form API elements for this instance.
* field_attach_insert(), or field_attach_update().
* - required (integer)
* - default_value_function (string): The name of the function, if any, that
* TRUE if a value for this field is required when used with this
* will provide a default value.
* bundle, FALSE otherwise. Currently, required-ness is only enforced
* - default_value (array): If default_value_function is not set, then fixed
* during Form API operations, not by field_attach_load(),
* values can be provided.
* field_attach_insert(), or field_attach_update().
* - deleted (integer, read-only): TRUE if this instance has been deleted,
* - default_value_function (string)
* FALSE otherwise. Deleted instances are ignored by the Field Attach API.
* The name of the function, if any, that will provide a default value.
* This property exists because instances can be marked for deletion but
* - default_value (array)
* only actually destroyed by a separate garbage-collection process.
* If default_value_function is not set, then fixed values can be provided.
* - settings (array): A sub-array of key/value pairs of field-type-specific
* - deleted (integer, read-only)
* instance settings. Each field type module defines and documents its own
* TRUE if this instance has been deleted, FALSE otherwise.
* instance settings.
* Deleted instances are ignored by the Field Attach API.
* - widget (array): A sub-array of key/value pairs identifying the Form API
* This property exists because instances can be marked for deletion but
* input widget for the field when used by this bundle:
* only actually destroyed by a separate garbage-collection process.
* - type (string): The type of the widget, such as text_textfield. Widget
* - settings (array)
* types are defined by modules that implement hook_field_widget_info().
* A sub-array of key/value pairs of field-type-specific instance
* - settings (array): A sub-array of key/value pairs of
* settings. Each field type module defines and documents its own
* widget-type-specific settings. Each field widget type module defines
* instance settings.
* and documents its own widget settings.
* - widget (array)
* - weight (float): The weight of the widget relative to the other elements
* A sub-array of key/value pairs identifying the Form API input widget
* in entity edit forms.
* for the field when used by this bundle.
* - module (string, read-only): The name of the module that implements the
* - type (string)
* widget type.
* The type of the widget, such as text_textfield. Widget types
* - display (array): A sub-array of key/value pairs identifying the way field
* are defined by modules that implement hook_field_widget_info().
* values should be displayed in each of the entity type's view modes, plus
* - settings (array)
* the 'default' mode. For each view mode, Field UI lets site administrators
* A sub-array of key/value pairs of widget-type-specific settings.
* define whether they want to use a dedicated set of display options or the
* Each field widget type module defines and documents its own
* 'default' options to reduce the number of displays to maintain as they
* widget settings.
* add new fields. For nodes, on a fresh install, only the 'teaser' view
* - weight (float)
* mode is configured to use custom display options, all other view modes
* The weight of the widget relative to the other elements in entity
* defined use the 'default' options by default. When programmatically
* edit forms.
* adding field instances on nodes, it is therefore recommended to at least
* - module (string, read-only)
* specify display options for 'default' and 'teaser':
* The name of the module that implements the widget type.
* - default (array): A sub-array of key/value pairs describing the display
* - display (array)
* options to be used when the field is being displayed in view modes
* A sub-array of key/value pairs identifying the way field values should
* that are not configured to use dedicated display options:
* be displayed in each of the entity type's view modes, plus the 'default'
* - label (string): Position of the label. 'inline', 'above' and
* mode. For each view mode, Field UI lets site administrators define
* 'hidden' are the values recognized by the default 'field' theme
* whether they want to use a dedicated set of display options or the
* implementation.
* 'default' options to reduce the number of displays to maintain as they
* - type (string): The type of the display formatter, or 'hidden' for
* add new fields. For nodes, on a fresh install, only the 'teaser' view
* no display.
* mode is configured to use custom display options, all other view modes
* - settings (array): A sub-array of key/value pairs of display
* defined use the 'default' options by default. When programmatically
* options specific to the formatter.
* adding field instances on nodes, it is therefore recommended to at least
* - weight (float): The weight of the field relative to the other entity
* specify display options for 'default' and 'teaser'.
* components displayed in this view mode.
* - default (array)
* - module (string, read-only): The name of the module which implements
* A sub-array of key/value pairs describing the display options to be
* the display formatter.
* used when the field is being displayed in view modes that are not
* - some_mode: A sub-array of key/value pairs describing the display
* configured to use dedicated display options.
* options to be used when the field is being displayed in the 'some_mode'
* - label (string)
* view mode. Those options will only be actually applied at run time if
* Position of the label. 'inline', 'above' and 'hidden' are the
* the view mode is not configured to use default settings for this bundle:
* values recognized by the default 'field' theme implementation.
* - ...
* - type (string)
* - other_mode:
* The type of the display formatter, or 'hidden' for no display.
* - ...
* - settings (array)
* A sub-array of key/value pairs of display options specific to
* the formatter.
* - weight (float)
* The weight of the field relative to the other entity components
* displayed in this view mode.
* - module (string, read-only)
* The name of the module which implements the display formatter.
* - some_mode
* A sub-array of key/value pairs describing the display options to be
* used when the field is being displayed in the 'some_mode' view mode.
* Those options will only be actually applied at run time if the view
* mode is not configured to use default settings for this bundle.
* - ...
* - other_mode
* - ...
*
*
* The (default) render arrays produced for field instances are documented at
* The (default) render arrays produced for field instances are documented at
* field_attach_view().
* field_attach_view().
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment