summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--modules/field/field.api.php130
-rw-r--r--modules/field/field.attach.inc232
-rw-r--r--modules/field/field.crud.inc70
-rw-r--r--modules/field/field.default.inc22
-rw-r--r--modules/field/field.form.inc4
-rw-r--r--modules/field/field.info2
-rw-r--r--modules/field/field.info.inc14
-rw-r--r--modules/field/field.module46
-rw-r--r--modules/field/field.multilingual.inc8
-rw-r--r--modules/field/modules/field_sql_storage/field_sql_storage.module21
-rw-r--r--modules/field/modules/text/text.test6
-rw-r--r--modules/field/tests/field.test170
-rw-r--r--modules/field/tests/field_test.entity.inc6
-rw-r--r--modules/field/tests/field_test.storage.inc10
-rw-r--r--modules/field/theme/field.tpl.php4
-rw-r--r--modules/field_ui/field_ui.admin.inc2
-rw-r--r--modules/field_ui/field_ui.module2
-rw-r--r--modules/field_ui/field_ui.test8
-rw-r--r--modules/file/file.field.inc10
19 files changed, 383 insertions, 384 deletions
diff --git a/modules/field/field.api.php b/modules/field/field.api.php
index 4a98eeba8..7af943d9a 100644
--- a/modules/field/field.api.php
+++ b/modules/field/field.api.php
@@ -7,7 +7,7 @@
*/
/**
- * Expose "pseudo-field" components on fieldable objects.
+ * Expose "pseudo-field" components on fieldable entities.
*
* Field UI's 'Manage fields' page lets users re-order fields, but also
* non-field components. For nodes, that would be title, menu settings, or
@@ -72,7 +72,7 @@ function hook_field_extra_fields() {
*
* The bulk of the Field Types API are related to field types. A field type
* represents a particular type of data (integer, string, date, etc.) that
- * can be attached to a fieldable object. hook_field_info() defines the basic
+ * can be attached to a fieldable entity. hook_field_info() defines the basic
* properties of a field type, and a variety of other field hooks are called by
* the Field Attach API to perform field-type-specific actions.
* @see hook_field_info().
@@ -90,7 +90,7 @@ function hook_field_extra_fields() {
*
* The Field Types API also defines two kinds of pluggable handlers: widgets
* and formatters, which specify how the field appears in edit forms and in
- * displayed objects. Widgets and formatters can be implemented by a field-type
+ * displayed entities. Widgets and formatters can be implemented by a field-type
* module for it's own field types, or by a third-party module to extend the
* behavior of existing field types.
* @see hook_field_widget_info().
@@ -241,9 +241,9 @@ function hook_field_schema($field) {
/**
* Defines custom load behavior for this module's field types.
*
- * Unlike most other field hooks, this hook operates on multiple objects. The
- * $entities, $instances and $items parameters are arrays keyed by object id.
- * For performance reasons, information for all available objects should be
+ * Unlike most other field hooks, this hook operates on multiple entities. The
+ * $entities, $instances and $items parameters are arrays keyed by entity id.
+ * For performance reasons, information for all available entity should be
* loaded in a single query where possible.
*
* Note that the changes made to the field values get cached by the field cache
@@ -255,19 +255,19 @@ function hook_field_schema($field) {
* @param $entity_type
* The type of $entity.
* @param $entities
- * Array of objects being loaded, keyed by object id.
+ * Array of entities being loaded, keyed by entity id.
* @param $field
* The field structure for the operation.
* @param $instances
- * Array of instance structures for $field for each object, keyed by object
+ * Array of instance structures for $field for each entity, keyed by entity
* id.
* @param $langcode
* The language associated to $items.
* @param $items
- * Array of field values already loaded for the objects, keyed by object id.
+ * Array of field values already loaded for the entities, keyed by entity id.
* @param $age
* FIELD_LOAD_CURRENT to load the most recent revision for all fields, or
- * FIELD_LOAD_REVISION to load the version indicated by each object.
+ * FIELD_LOAD_REVISION to load the version indicated by each entity.
* @return
* Changes or additions to field values are done by altering the $items
* parameter by reference.
@@ -297,19 +297,19 @@ function hook_field_load($entity_type, $entities, $field, $instances, $langcode,
* hook_field_formatter_prepare_view().
* @see hook_field_formatter_prepare_view()
*
- * Unlike most other field hooks, this hook operates on multiple objects. The
- * $entities, $instances and $items parameters are arrays keyed by object id.
- * For performance reasons, information for all available objects should be
+ * Unlike most other field hooks, this hook operates on multiple entities. The
+ * $entities, $instances and $items parameters are arrays keyed by entity id.
+ * For performance reasons, information for all available entities should be
* loaded in a single query where possible.
*
* @param $entity_type
* The type of $entity.
* @param $entities
- * Array of objects being displayed, keyed by object id.
+ * Array of entities being displayed, keyed by entity id.
* @param $field
* The field structure for the operation.
* @param $instances
- * Array of instance structures for $field for each object, keyed by object
+ * Array of instance structures for $field for each entity, keyed by entity
* id.
* @param $langcode
* The language associated to $items.
@@ -338,7 +338,7 @@ function hook_field_prepare_view($entity_type, $entities, $field, $instances, $l
* @param $entity_type
* The type of $entity.
* @param $entity
- * The object for the operation.
+ * The entity for the operation.
* @param $field
* The field structure for the operation.
* @param $instance
@@ -349,7 +349,7 @@ function hook_field_prepare_view($entity_type, $entities, $field, $instances, $l
* $entity->{$field['field_name']}[$langcode], or an empty array if unset.
* @param $errors
* The array of errors, keyed by field name and by value delta, that have
- * already been reported for the object. The function should add its errors
+ * already been reported for the entity. The function should add its errors
* to this array. Each error is an associative array, with the following
* keys and values:
* - 'error': an error code (should be a string, prefixed with the module name)
@@ -374,7 +374,7 @@ function hook_field_validate($entity_type, $entity, $field, $instance, $langcode
* @param $entity_type
* The type of $entity.
* @param $entity
- * The object for the operation.
+ * The entity for the operation.
* @param $field
* The field structure for the operation.
* @param $instance
@@ -402,7 +402,7 @@ function hook_field_presave($entity_type, $entity, $field, $instance, $langcode,
* @param $entity_type
* The type of $entity.
* @param $entity
- * The object for the operation.
+ * The entity for the operation.
* @param $field
* The field structure for the operation.
* @param $instance
@@ -421,7 +421,7 @@ function hook_field_insert($entity_type, $entity, $field, $instance, $langcode,
* @param $entity_type
* The type of $entity.
* @param $entity
- * The object for the operation.
+ * The entity for the operation.
* @param $field
* The field structure for the operation.
* @param $instance
@@ -442,7 +442,7 @@ function hook_field_update($entity_type, $entity, $field, $instance, $langcode,
* @param $entity_type
* The type of $entity.
* @param $entity
- * The object for the operation.
+ * The entity for the operation.
* @param $field
* The field structure for the operation.
* @param $instance
@@ -464,7 +464,7 @@ function hook_field_delete($entity_type, $entity, $field, $instance, $langcode,
* @param $entity_type
* The type of $entity.
* @param $entity
- * The object for the operation.
+ * The entity for the operation.
* @param $field
* The field structure for the operation.
* @param $instance
@@ -485,7 +485,7 @@ function hook_field_delete_revision($entity_type, $entity, $field, $instance, $l
* @param $entity_type
* The type of $entity.
* @param $entity
- * The object for the operation.
+ * The entity for the operation.
* @param $field
* The field structure for the operation.
* @param $instance
@@ -614,7 +614,7 @@ function hook_field_widget_info_alter(&$info) {
* call this function as many times as needed.
*
* Note that, depending on the context in which the widget is being included
- * (regular object edit form, 'default value' input in the field settings form,
+ * (regular entity edit form, 'default value' input in the field settings form,
* etc...), the passed in values for $field and $instance might be different
* from the official definitions returned by field_info_field() and
* field_info_instance(). If the widget uses Form API callbacks (like
@@ -640,7 +640,7 @@ function hook_field_widget_info_alter(&$info) {
* The order of this item in the array of subelements (0, 1, 2, etc).
* @param $element
* A form element array containing basic properties for the widget:
- * - #object_type: The name of the object the field is attached to.
+ * - #object_type: The name of the entity the field is attached to.
* - #bundle: The name of the field bundle the field is contained in.
* - #field_name: The name of the field.
* - #language: The language the field is being edited in.
@@ -769,32 +769,32 @@ function hook_field_formatter_info_alter(&$info) {
*
* This should be used when a formatter needs to load additional information
* from the database in order to render a field, for example a reference field
- * which displays properties of the referenced objects such as name or type.
+ * which displays properties of the referenced entities such as name or type.
*
* This hook is called after the field type's own hook_field_prepare_view().
* @see hook_field_prepare_view()
*
- * Unlike most other field hooks, this hook operates on multiple objects. The
- * $entities, $instances and $items parameters are arrays keyed by object id.
- * For performance reasons, information for all available objects should be
+ * Unlike most other field hooks, this hook operates on multiple entities. The
+ * $entities, $instances and $items parameters are arrays keyed by entity id.
+ * For performance reasons, information for all available entities should be
* loaded in a single query where possible.
*
* @param $entity_type
* The type of $entity.
* @param $entities
- * Array of objects being displayed, keyed by object id.
+ * Array of entities being displayed, keyed by entity id.
* @param $field
* The field structure for the operation.
* @param $instances
- * Array of instance structures for $field for each object, keyed by object
+ * Array of instance structures for $field for each entity, keyed by entity
* id.
* @param $langcode
* The language the field values are to be shown in. If no language is
* provided the current language is used.
* @param $items
- * Array of field values for the objects, keyed by object id.
+ * Array of field values for the entities, keyed by entity id.
* @param $displays
- * Array of display settings to use for each object, keyed by object id.
+ * Array of display settings to use for each entity, keyed by entity id.
* @return
* Changes or additions to field values are done by altering the $items
* parameter by reference.
@@ -809,7 +809,7 @@ function hook_field_formatter_prepare_view($entity_type, $entities, $field, $ins
* @param $entity_type
* The type of $entity.
* @param $entity
- * The object being displayed.
+ * The entity being displayed.
* @param $field
* The field structure.
* @param $instance
@@ -932,11 +932,11 @@ function hook_field_attach_form($entity_type, $entity, &$form, &$form_state, $la
* This hook is invoked after the field module has performed the operation.
*
* Unlike other field_attach hooks, this hook accounts for 'multiple loads'.
- * Instead of the usual $entity parameter, it accepts an array of objects,
- * indexed by object id. For performance reasons, information for all available
- * objects should be loaded in a single query where possible.
+ * Instead of the usual $entity parameter, it accepts an array of entities,
+ * indexed by entity id. For performance reasons, information for all available
+ * entities should be loaded in a single query where possible.
*
- * The changes made to the objects' field values get cached by the field cache
+ * The changes made to the entities' field values get cached by the field cache
* for subsequent loads.
*
* See field_attach_load() for details and arguments.
@@ -1005,7 +1005,7 @@ function hook_field_attach_update($entity_type, $entity) {
* @param $context
* An associative array containing:
* - obj_type: The type of $entity; e.g. 'node' or 'user'.
- * - object: The object with fields to render.
+ * - object: The entity with fields to render.
* - element: The structured array containing the values ready for rendering.
*/
function hook_field_attach_preprocess_alter(&$variables, $context) {
@@ -1041,7 +1041,7 @@ function hook_field_attach_delete_revision($entity_type, $entity) {
* @param $context
* An associative array containing:
* - obj_type: The type of $entity; e.g. 'node' or 'user'.
- * - object: The object with fields to render.
+ * - object: The entity with fields to render.
* - view_mode: View mode, e.g. 'full', 'teaser'...
* - langcode: The language in which the field values will be displayed.
*/
@@ -1074,7 +1074,7 @@ function hook_field_attach_rename_bundle($entity_type, $bundle_old, $bundle_new)
* This hook is invoked after the field module has performed the operation.
*
* @param $entity_type
- * The type of object; e.g. 'node' or 'user'.
+ * The type of entity; e.g. 'node' or 'user'.
* @param $bundle
* The bundle that was just deleted.
* @param $instances
@@ -1171,19 +1171,19 @@ function hook_field_storage_details_alter(&$details, $field) {
}
/**
- * Load field data for a set of objects.
+ * Load field data for a set of entities.
*
* @param $entity_type
- * The entity type of object, such as 'node' or 'user'.
+ * The entity type of entity, such as 'node' or 'user'.
* @param $entities
- * The array of objects for which to load data, keyed by object id.
+ * The array of entities for which to load data, keyed by entity id.
* @param $age
* FIELD_LOAD_CURRENT to load the most recent revision for all
* fields, or FIELD_LOAD_REVISION to load the version indicated by
- * each object.
+ * each entity.
* @param $fields
* An array listing the fields to be loaded. The keys of the array are field
- * ids, the values of the array are the object ids (or revision ids,
+ * ids, the values of the array are the entity ids (or revision ids,
* depending on the $age parameter) to be loaded for each field.
* @return
* Loaded field values are added to $entities. Fields with no values should be
@@ -1193,15 +1193,15 @@ function hook_field_storage_load($entity_type, $entities, $age, $fields) {
}
/**
- * Write field data for an object.
+ * Write field data for an entity.
*
* @param $entity_type
- * The entity type of object, such as 'node' or 'user'.
+ * The entity type of entity, such as 'node' or 'user'.
* @param $entity
- * The object on which to operate.
+ * The entity on which to operate.
* @param $op
- * FIELD_STORAGE_UPDATE when updating an existing object,
- * FIELD_STORAGE_INSERT when inserting a new object.
+ * FIELD_STORAGE_UPDATE when updating an existing entity,
+ * FIELD_STORAGE_INSERT when inserting a new entity.
* @param $fields
* An array listing the fields to be written. The keys and values of the
* array are field ids.
@@ -1210,12 +1210,12 @@ function hook_field_storage_write($entity_type, $entity, $op, $fields) {
}
/**
- * Delete all field data for an object.
+ * Delete all field data for an entity.
*
* @param $entity_type
- * The entity type of object, such as 'node' or 'user'.
+ * The entity type of entity, such as 'node' or 'user'.
* @param $entity
- * The object on which to operate.
+ * The entity on which to operate.
* @param $fields
* An array listing the fields to delete. The keys and values of the
* array are field ids.
@@ -1224,16 +1224,16 @@ function hook_field_storage_delete($entity_type, $entity, $fields) {
}
/**
- * Delete a single revision of field data for an object.
+ * Delete a single revision of field data for an entity.
*
* Deleting the current (most recently written) revision is not
* allowed as has undefined results.
*
* @param $entity_type
- * The entity type of object, such as 'node' or 'user'.
+ * The entity type of entity, such as 'node' or 'user'.
* @param $entity
- * The object on which to operate. The revision to delete is
- * indicated by the object's revision id property, as identified by
+ * The entity on which to operate. The revision to delete is
+ * indicated by the entity's revision id property, as identified by
* hook_fieldable_info() for $entity_type.
* @param $fields
* An array listing the fields to delete. The keys and values of the
@@ -1298,12 +1298,12 @@ function hook_field_storage_delete_instance($instance) {
* Possible use cases include: per-bundle storage, per-combo-field storage...
*
* @param $entity_type
- * The type of objects for which to load fields; e.g. 'node' or 'user'.
+ * The type of entity for which to load fields; e.g. 'node' or 'user'.
* @param $entities
- * An array of objects for which to load fields, keyed by object id.
+ * An array of entities for which to load fields, keyed by entity id.
* @param $age
* FIELD_LOAD_CURRENT to load the most recent revision for all fields, or
- * FIELD_LOAD_REVISION to load the version indicated by each object.
+ * FIELD_LOAD_REVISION to load the version indicated by each entity.
* @param $skip_fields
* An array keyed by field ids whose data has already been loaded and
* therefore should not be loaded again. The values associated to these keys
@@ -1325,7 +1325,7 @@ function hook_field_storage_pre_load($entity_type, $entities, $age, &$skip_field
* @param $entity_type
* The type of $entity; e.g. 'node' or 'user'.
* @param $entity
- * The object with fields to save.
+ * The entity with fields to save.
* @param $skip_fields
* An array keyed by field ids whose data has already been written and
* therefore should not be written again. The values associated to these keys
@@ -1362,7 +1362,7 @@ function hook_field_storage_pre_insert($entity_type, $entity, &$skip_fields) {
* @param $entity_type
* The type of $entity; e.g. 'node' or 'user'.
* @param $entity
- * The object with fields to save.
+ * The entity with fields to save.
* @param $skip_fields
* An array keyed by field ids whose data has already been written and
* therefore should not be written again. The values associated to these keys
@@ -1375,7 +1375,7 @@ function hook_field_storage_pre_update($entity_type, $entity, &$skip_fields) {
if ($entity_type == 'node' && $entity->status && _forum_node_check_node_type($entity)) {
// We don't maintain data for old revisions, so clear all previous values
- // from the table. Since this hook runs once per field, per object, make
+ // from the table. Since this hook runs once per field, per entity, make
// sure we only wipe values once.
if (!isset($first_call[$entity->nid])) {
$first_call[$entity->nid] = FALSE;
@@ -1595,7 +1595,7 @@ function hook_field_read_instance($instance) {
* @param $entity_type
* The type of $entity; e.g. 'node' or 'user'.
* @param $entity
- * (optional) The object for the operation.
+ * (optional) The entity for the operation.
* @param $account
* (optional) The account to check, if not given use currently logged in user.
* @return
diff --git a/modules/field/field.attach.inc b/modules/field/field.attach.inc
index 661de3649..d62b6dcb3 100644
--- a/modules/field/field.attach.inc
+++ b/modules/field/field.attach.inc
@@ -3,7 +3,7 @@
/**
* @file
- * Field attach API, allowing objects (nodes, users, ...) to be 'fieldable'.
+ * Field attach API, allowing entities (nodes, users, ...) to be 'fieldable'.
*/
/**
@@ -60,14 +60,14 @@ class FieldQueryException extends FieldException {}
* Argument for an update operation.
*
* This is used in hook_field_storage_write when updating an
- * existing object.
+ * existing entity.
*/
define('FIELD_STORAGE_UPDATE', 'update');
/**
* Argument for an insert operation.
*
- * This is used in hook_field_storage_write when inserting a new object.
+ * This is used in hook_field_storage_write when inserting a new entity.
*/
define('FIELD_STORAGE_INSERT', 'insert');
@@ -78,17 +78,17 @@ define('FIELD_STORAGE_INSERT', 'insert');
/**
* @defgroup field_attach Field Attach API
* @{
- * Operate on Field API data attached to Drupal objects.
+ * Operate on Field API data attached to Drupal entities.
*
* Field Attach API functions load, store, generate Form API
* structures, display, and perform a variety of other functions for
- * field data connected to individual objects.
+ * field data connected to individual entities.
*
* Field Attach API functions generally take $entity_type and $entity
* arguments along with additional function-specific arguments.
* $entity_type is the type of the fieldable entity, such as 'node' or
- * 'user', and $entity is the object itself. An individual object's
- * bundle, if any, is read from the object's bundle key property
+ * 'user', and $entity is the entity itself. An individual entity's
+ * bundle, if any, is read from the entity's bundle key property
* identified by hook_fieldable_info() for $entity_type.
*
* Fieldable types call Field Attach API functions during their own
@@ -98,8 +98,8 @@ define('FIELD_STORAGE_INSERT', 'insert');
*
* Most Field Attach API functions define a corresponding hook
* function that allows any module to act on Field Attach operations
- * for any object after the operation is complete, and access or
- * modify all the field, form, or display data for that object and
+ * for any entity after the operation is complete, and access or
+ * modify all the field, form, or display data for that entity and
* operation. For example, field_attach_view() invokes
* hook_field_attach_view_alter(). These all-module hooks are distinct from
* those of the Field Types API, such as hook_field_load(), that are
@@ -139,7 +139,7 @@ define('FIELD_STORAGE_INSERT', 'insert');
* @param $entity_type
* The type of $entity; e.g. 'node' or 'user'.
* @param $entity
- * The fully formed $entity_type object.
+ * The fully formed $entity_type entity.
* @param $a
* - The $form in the 'form' operation.
* - The value of $view_mode in the 'view' operation.
@@ -151,12 +151,12 @@ define('FIELD_STORAGE_INSERT', 'insert');
* An associative array of additional options, with the following keys:
* - 'field_name': The name of the field whose operation should be
* invoked. By default, the operation is invoked on all the fields
- * in the object's bundle. NOTE: This option is not compatible with
+ * in the entity's bundle. NOTE: This option is not compatible with
* the 'deleted' option; the 'field_id' option should be used
* instead.
* - 'field_id': The id of the field whose operation should be
* invoked. By default, the operation is invoked on all the fields
- * in the objects' bundles.
+ * in the entity's' bundles.
* - 'default': A boolean value, specifying which implementation of
* the operation should be invoked.
* - if FALSE (default), the field types implementation of the operation
@@ -178,7 +178,7 @@ function _field_invoke($op, $entity_type, $entity, &$a = NULL, &$b = NULL, $opti
);
$options += $default_options;
- // Iterate through the object's field instances.
+ // Iterate through the entity's field instances.
$return = array();
list(, , $bundle) = entity_extract_ids($entity_type, $entity);
@@ -234,7 +234,7 @@ function _field_invoke($op, $entity_type, $entity, &$a = NULL, &$b = NULL, $opti
}
/**
- * Invoke a field hook across fields on multiple objects.
+ * Invoke a field hook across fields on multiple entities.
*
* @param $op
* Possible operations include:
@@ -245,7 +245,7 @@ function _field_invoke($op, $entity_type, $entity, &$a = NULL, &$b = NULL, $opti
* @param $entity_type
* The type of $entity; e.g. 'node' or 'user'.
* @param $entities
- * An array of objects, keyed by object id.
+ * An array of entities, keyed by entity id.
* @param $a
* - The $age parameter in the 'load' operation.
* - Otherwise NULL.
@@ -255,11 +255,11 @@ function _field_invoke($op, $entity_type, $entity, &$a = NULL, &$b = NULL, $opti
* An associative array of additional options, with the following keys:
* - 'field_name': The name of the field whose operation should be
* invoked. By default, the operation is invoked on all the fields
- * in the object's bundle. NOTE: This option is not compatible with
+ * in the entity's bundle. NOTE: This option is not compatible with
* the 'deleted' option; the 'field_id' option should be used instead.
* - 'field_id': The id of the field whose operation should be
* invoked. By default, the operation is invoked on all the fields
- * in the objects' bundles.
+ * in the entity's' bundles.
* - 'default': A boolean value, specifying which implementation of
* the operation should be invoked.
* - if FALSE (default), the field types implementation of the operation
@@ -272,7 +272,7 @@ function _field_invoke($op, $entity_type, $entity, &$a = NULL, &$b = NULL, $opti
* as well as non-deleted fields. If unset or FALSE, only
* non-deleted fields are operated on.
* @return
- * An array of returned values keyed by object id.
+ * An array of returned values keyed by entity id.
*/
function _field_invoke_multiple($op, $entity_type, $entities, &$a = NULL, &$b = NULL, $options = array()) {
// Merge default options.
@@ -285,15 +285,15 @@ function _field_invoke_multiple($op, $entity_type, $entities, &$a = NULL, &$b =
$fields = array();
$grouped_instances = array();
- $grouped_objects = array();
+ $grouped_entities = array();
$grouped_items = array();
$return = array();
- // Go through the objects and collect the fields on which the hook should be
+ // Go through the entities and collect the fields on which the hook should be
// invoked.
//
// We group fields by id, not by name, because this function can operate on
- // deleted fields which may have non-unique names. However, objects can only
+ // deleted fields which may have non-unique names. However, entities can only
// contain data for a single field for each name, even if that field
// is deleted, so we reference field data via the
// $entity->$field_name property.
@@ -316,9 +316,9 @@ function _field_invoke_multiple($op, $entity_type, $entities, &$a = NULL, &$b =
if (!isset($fields[$field_id])) {
$fields[$field_id] = field_info_field_by_id($field_id);
}
- // Group the corresponding instances and objects.
+ // Group the corresponding instances and entities.
$grouped_instances[$field_id][$id] = $instance;
- $grouped_objects[$field_id][$id] = $entities[$id];
+ $grouped_entities[$field_id][$id] = $entities[$id];
// Extract the field values into a separate variable, easily accessed
// by hook implementations.
$suggested_languages = empty($options['language']) ? NULL : array($options['language']);
@@ -327,7 +327,7 @@ function _field_invoke_multiple($op, $entity_type, $entities, &$a = NULL, &$b =
}
}
}
- // Initialize the return value for each object.
+ // Initialize the return value for each entity.
$return[$id] = array();
}
@@ -338,9 +338,9 @@ function _field_invoke_multiple($op, $entity_type, $entities, &$a = NULL, &$b =
if (function_exists($function)) {
// Iterate over all the field translations.
foreach ($grouped_items[$field_id] as $langcode => $items) {
- $results = $function($entity_type, $grouped_objects[$field_id], $field, $grouped_instances[$field_id], $langcode, $grouped_items[$field_id][$langcode], $a, $b);
+ $results = $function($entity_type, $grouped_entities[$field_id], $field, $grouped_instances[$field_id], $langcode, $grouped_items[$field_id][$langcode], $a, $b);
if (isset($results)) {
- // Collect results by object.
+ // Collect results by entity.
// For hooks with array results, we merge results together.
// For hooks with scalar results, we collect results in an array.
foreach ($results as $id => $result) {
@@ -355,9 +355,9 @@ function _field_invoke_multiple($op, $entity_type, $entities, &$a = NULL, &$b =
}
}
- // Populate field values back in the objects, but avoid replacing missing
+ // Populate field values back in the entities, but avoid replacing missing
// fields with an empty array (those are not equivalent on update).
- foreach ($grouped_objects[$field_id] as $id => $entity) {
+ foreach ($grouped_entities[$field_id] as $id => $entity) {
foreach ($grouped_items[$field_id] as $langcode => $items) {
if ($grouped_items[$field_id][$langcode][$id] !== array() || isset($entity->{$field_name}[$langcode])) {
$entity->{$field_name}[$langcode] = $grouped_items[$field_id][$langcode][$id];
@@ -384,7 +384,7 @@ function _field_invoke_default($op, $entity_type, $entity, &$a = NULL, &$b = NUL
}
/**
- * Invoke field.module's version of a field hook on multiple objects.
+ * Invoke field.module's version of a field hook on multiple entities.
*
* This function invokes the field_default_[op]() function.
* Use _field_invoke_multiple() to invoke the field type implementation,
@@ -398,7 +398,7 @@ function _field_invoke_multiple_default($op, $entity_type, $entities, &$a = NULL
}
/**
- * Add form elements for all fields for an object to a form structure.
+ * Add form elements for all fields for an entity to a form structure.
*
* Sample structure for $form:
* @code
@@ -476,7 +476,7 @@ function _field_invoke_multiple_default($op, $entity_type, $entities, &$a = NULL
* @param $entity_type
* The type of $entity; e.g. 'node' or 'user'.
* @param $entity
- * The object for which to load form elements, used to initialize
+ * The entity for which to load form elements, used to initialize
* default form values.
* @param $form
* The form structure to fill in.
@@ -511,23 +511,23 @@ function field_attach_form($entity_type, $entity, &$form, &$form_state, $langcod
/**
* Load all fields for the most current version of each of a set of
- * objects of a single object type.
+ * entities of a single entity type.
*
* @param $entity_type
* The type of $entity; e.g. 'node' or 'user'.
* @param $entities
- * An array of objects for which to load fields, keyed by object id.
- * Each object needs to have its 'bundle', 'id' and (if applicable)
+ * An array of entities for which to load fields, keyed by entity id.
+ * Each entity needs to have its 'bundle', 'id' and (if applicable)
* 'revision' keys filled.
* @param $age
* FIELD_LOAD_CURRENT to load the most recent revision for all
* fields, or FIELD_LOAD_REVISION to load the version indicated by
- * each object. Defaults to FIELD_LOAD_CURRENT; use
+ * each entity. Defaults to FIELD_LOAD_CURRENT; use
* field_attach_load_revision() instead of passing FIELD_LOAD_REVISION.
* @param $options
* An associative array of additional options, with the following keys:
* - 'field_id': The field id that should be loaded, instead of
- * loading all fields, for each object. Note that returned objects
+ * loading all fields, for each entity. Note that returned entities
* may contain data for other fields, for example if they are read
* from a cache.
* - 'deleted': If TRUE, the function will operate on deleted fields
@@ -556,11 +556,11 @@ function field_attach_load($entity_type, $entities, $age = FIELD_LOAD_CURRENT, $
return;
}
- // Assume all objects will need to be queried. Objects found in the cache
+ // Assume all entities will need to be queried. Entities found in the cache
// will be removed from the list.
- $queried_objects = $entities;
+ $queried_entities = $entities;
- // Fetch available objects from cache, if applicable.
+ // Fetch available entities from cache, if applicable.
if ($cache_read) {
// Build the list of cache entries to retrieve.
$cids = array();
@@ -568,12 +568,12 @@ function field_attach_load($entity_type, $entities, $age = FIELD_LOAD_CURRENT, $
$cids[] = "field:$entity_type:$id";
}
$cache = cache_get_multiple($cids, 'cache_field');
- // Put the cached field values back into the objects and remove them from
- // the list of objects to query.
+ // Put the cached field values back into the entities and remove them from
+ // the list of entities to query.
foreach ($entities as $id => $entity) {
$cid = "field:$entity_type:$id";
if (isset($cache[$cid])) {
- unset($queried_objects[$id]);
+ unset($queried_entities[$id]);
foreach ($cache[$cid]->data as $field_name => $values) {
$entity->$field_name = $values;
}
@@ -581,8 +581,8 @@ function field_attach_load($entity_type, $entities, $age = FIELD_LOAD_CURRENT, $
}
}
- // Fetch other objects from their storage location.
- if ($queried_objects) {
+ // Fetch other entities from their storage location.
+ if ($queried_entities) {
// The invoke order is:
// - hook_field_storage_pre_load()
// - storage backend's hook_field_storage_load()
@@ -594,13 +594,13 @@ function field_attach_load($entity_type, $entities, $age = FIELD_LOAD_CURRENT, $
$skip_fields = array();
foreach (module_implements('field_storage_pre_load') as $module) {
$function = $module . '_field_storage_pre_load';
- $function($entity_type, $queried_objects, $age, $skip_fields, $options);
+ $function($entity_type, $queried_entities, $age, $skip_fields, $options);
}
- // Collect the storage backends used by the remaining fields in the objects.
+ // Collect the storage backends used by the remaining fields in the entities.
$storages = array();
- foreach ($queried_objects as $obj) {
- list($id, $vid, $bundle) = entity_extract_ids($entity_type, $obj);
+ foreach ($queried_entities as $entity) {
+ list($id, $vid, $bundle) = entity_extract_ids($entity_type, $entity);
if ($options['deleted']) {
$instances = field_read_instances(array('object_type' => $entity_type, 'bundle' => $bundle), array('include_deleted' => $options['deleted']));
}
@@ -613,8 +613,8 @@ function field_attach_load($entity_type, $entities, $age = FIELD_LOAD_CURRENT, $
$field_name = $instance['field_name'];
$field_id = $instance['field_id'];
// Make sure all fields are present at least as empty arrays.
- if (!isset($queried_objects[$id]->{$field_name})) {
- $queried_objects[$id]->{$field_name} = array();
+ if (!isset($queried_entities[$id]->{$field_name})) {
+ $queried_entities[$id]->{$field_name} = array();
}
// Collect the storage backend if the field has not been loaded yet.
if (!isset($skip_fields[$field_id])) {
@@ -628,24 +628,24 @@ function field_attach_load($entity_type, $entities, $age = FIELD_LOAD_CURRENT, $
// Invoke hook_field_storage_load() on the relevant storage backends.
foreach ($storages as $storage => $fields) {
$storage_info = field_info_storage_types($storage);
- module_invoke($storage_info['module'], 'field_storage_load', $entity_type, $queried_objects, $age, $fields, $options);
+ module_invoke($storage_info['module'], 'field_storage_load', $entity_type, $queried_entities, $age, $fields, $options);
}
// Invoke field-type module's hook_field_load().
- _field_invoke_multiple('load', $entity_type, $queried_objects, $age, $options);
+ _field_invoke_multiple('load', $entity_type, $queried_entities, $age, $options);
// Invoke hook_field_attach_load(): let other modules act on loading the
- // object.
- module_invoke_all('field_attach_load', $entity_type, $queried_objects, $age, $options);
+ // entitiy.
+ module_invoke_all('field_attach_load', $entity_type, $queried_entities, $age, $options);
// Build cache data.
if ($cache_write) {
- foreach ($queried_objects as $id => $entity) {
+ foreach ($queried_entities as $id => $entity) {
$data = array();
list($id, $vid, $bundle) = entity_extract_ids($entity_type, $entity);
$instances = field_info_instances($entity_type, $bundle);
foreach ($instances as $instance) {
- $data[$instance['field_name']] = $queried_objects[$id]->{$instance['field_name']};
+ $data[$instance['field_name']] = $queried_entities[$id]->{$instance['field_name']};
}
$cid = "field:$entity_type:$id";
cache_set($cid, $data, 'cache_field');
@@ -656,25 +656,25 @@ function field_attach_load($entity_type, $entities, $age = FIELD_LOAD_CURRENT, $
/**
* Load all fields for a previous version of each of a set of
- * objects of a single object type.
+ * entities of a single entity type.
*
- * Loading different versions of the same objects is not supported,
+ * Loading different versions of the same entities is not supported,
* and should be done by separate calls to the function.
*
* @param $entity_type
* The type of $entity; e.g. 'node' or 'user'.
* @param $entities
- * An array of objects for which to load fields, keyed by object id.
- * Each object needs to have its 'bundle', 'id' and (if applicable)
+ * An array of entities for which to load fields, keyed by entity id.
+ * Each entity needs to have its 'bundle', 'id' and (if applicable)
* 'revision' keys filled.
* @param $options
* An associative array of additional options, with the following keys:
* - 'field_name': The field name that should be loaded, instead of
- * loading all fields, for each object. Note that returned objects
+ * loading all fields, for each entity. Note that returned entities
* may contain data for other fields, for example if they are read
* from a cache.
* @return
- * On return, the objects in $entities are modified by having the
+ * On return, the entities in $entities are modified by having the
* appropriate set of fields added.
*/
function field_attach_load_revision($entity_type, $entities, $options = array()) {
@@ -682,7 +682,7 @@ function field_attach_load_revision($entity_type, $entities, $options = array())
}
/**
- * Perform field validation against the field data in an object.
+ * Perform field validation against the field data in an entity.
*
* This function does not perform field widget validation on form
* submissions. It is intended to be called during API save
@@ -692,7 +692,7 @@ function field_attach_load_revision($entity_type, $entities, $options = array())
* @param $entity_type
* The type of $entity; e.g. 'node' or 'user'.
* @param $entity
- * The object with fields to validate.
+ * The entity with fields to validate.
* @throws FieldValidationException
* If validation errors are found, a FieldValidationException is thrown. The
* 'errors' property contains the array of errors, keyed by field name,
@@ -705,7 +705,7 @@ function field_attach_validate($entity_type, $entity) {
// Check field-type specific errors.
_field_invoke('validate', $entity_type, $entity, $errors);
- // Let other modules validate the object.
+ // Let other modules validate the entity.
// Avoid module_invoke_all() to let $errors be taken by reference.
foreach (module_implements('field_attach_validate') as $module) {
$function = $module . '_field_attach_validate';
@@ -731,13 +731,13 @@ function field_attach_validate($entity_type, $entity) {
*
* This function performs field validation in the context of a form
* submission. It converts field validation errors into form errors
- * on the correct form elements. Fieldable object types should call
+ * on the correct form elements. Fieldable entity types should call
* this function during their own form validation function.
*
* @param $entity_type
* The type of $entity; e.g. 'node' or 'user'.
* @param $entity
- * The object being submitted. The 'bundle', 'id' and (if applicable)
+ * The entity being submitted. The 'bundle', 'id' and (if applicable)
* 'revision' keys should be present. The actual field values will be read
* from $form_state['values'].
* @param $form
@@ -774,7 +774,7 @@ function field_attach_form_validate($entity_type, $entity, $form, &$form_state)
* @param $entity_type
* The type of $entity; e.g. 'node' or 'user'.
* @param $entity
- * The object being submitted. The 'bundle', 'id' and (if applicable)
+ * The entity being submitted. The 'bundle', 'id' and (if applicable)
* 'revision' keys should be present. The actual field values will be read
* from $form_state['values'].
* @param $form
@@ -788,7 +788,7 @@ function field_attach_submit($entity_type, $entity, $form, &$form_state) {
_field_invoke_default('submit', $entity_type, $entity, $form, $form_state);
- // Let other modules act on submitting the object.
+ // Let other modules act on submitting the entity.
// Avoid module_invoke_all() to let $form_state be taken by reference.
foreach (module_implements('field_attach_submit') as $module) {
$function = $module . '_field_attach_submit';
@@ -805,19 +805,19 @@ function field_attach_submit($entity_type, $entity, $form, &$form_state) {
* @param $entity_type
* The type of $entity; e.g. 'node' or 'user'.
* @param $entity
- * The object with fields to process.
+ * The entity with fields to process.
*/
function field_attach_presave($entity_type, $entity) {
_field_invoke('presave', $entity_type, $entity);
- // Let other modules act on presaving the object.
+ // Let other modules act on presaving the entity.
module_invoke_all('field_attach_presave', $entity_type, $entity);
}
/**
- * Save field data for a new object.
+ * Save field data for a new entity.
*
- * The passed in object must already contain its id and (if applicable)
+ * The passed in entity must already contain its id and (if applicable)
* revision id attributes.
* Default values (if any) will be saved for fields not present in the
* $entity.
@@ -825,7 +825,7 @@ function field_attach_presave($entity_type, $entity) {
* @param $entity_type
* The type of $entity; e.g. 'node' or 'user'.
* @param $entity
- * The object with fields to save.
+ * The entity with fields to save.
* @return
* Default values (if any) will be added to the $entity parameter for fields
* it leaves unspecified.
@@ -844,7 +844,7 @@ function field_attach_insert($entity_type, $entity) {
$function($entity_type, $entity, $skip_fields);
}
- // Collect the storage backends used by the remaining fields in the objects.
+ // Collect the storage backends used by the remaining fields in the entities.
$storages = array();
foreach (field_info_instances($entity_type, $bundle) as $instance) {
$field = field_info_field_by_id($instance['field_id']);
@@ -864,7 +864,7 @@ function field_attach_insert($entity_type, $entity) {
module_invoke($storage_info['module'], 'field_storage_write', $entity_type, $entity, FIELD_STORAGE_INSERT, $fields);
}
- // Let other modules act on inserting the object.
+ // Let other modules act on inserting the entity.
module_invoke_all('field_attach_insert', $entity_type, $entity);
if ($cacheable) {
@@ -873,12 +873,12 @@ function field_attach_insert($entity_type, $entity) {
}
/**
- * Save field data for an existing object.
+ * Save field data for an existing entity.
*
* @param $entity_type
* The type of $entity; e.g. 'node' or 'user'.
* @param $entity
- * The object with fields to save.
+ * The entity with fields to save.
*/
function field_attach_update($entity_type, $entity) {
_field_invoke('update', $entity_type, $entity);
@@ -893,7 +893,7 @@ function field_attach_update($entity_type, $entity) {
$function($entity_type, $entity, $skip_fields);
}
- // Collect the storage backends used by the remaining fields in the objects.
+ // Collect the storage backends used by the remaining fields in the entities.
$storages = array();
foreach (field_info_instances($entity_type, $bundle) as $instance) {
$field = field_info_field_by_id($instance['field_id']);
@@ -917,7 +917,7 @@ function field_attach_update($entity_type, $entity) {
module_invoke($storage_info['module'], 'field_storage_write', $entity_type, $entity, FIELD_STORAGE_UPDATE, $fields);
}
- // Let other modules act on updating the object.
+ // Let other modules act on updating the entity.
module_invoke_all('field_attach_update', $entity_type, $entity);
if ($cacheable) {
@@ -926,20 +926,20 @@ function field_attach_update($entity_type, $entity) {
}
/**
- * Delete field data for an existing object. This deletes all
- * revisions of field data for the object.
+ * Delete field data for an existing entity. This deletes all
+ * revisions of field data for the entity.
*
* @param $entity_type
* The type of $entity; e.g. 'node' or 'user'.
* @param $entity
- * The object whose field data to delete.
+ * The entity whose field data to delete.
*/
function field_attach_delete($entity_type, $entity) {
_field_invoke('delete', $entity_type, $entity);
list($id, $vid, $bundle, $cacheable) = entity_extract_ids($entity_type, $entity);
- // Collect the storage backends used by the fields in the objects.
+ // Collect the storage backends used by the fields in the entities.
$storages = array();
foreach (field_info_instances($entity_type, $bundle) as $instance) {
$field = field_info_field_by_id($instance['field_id']);
@@ -953,7 +953,7 @@ function field_attach_delete($entity_type, $entity) {
module_invoke($storage_info['module'], 'field_storage_delete', $entity_type, $entity, $fields);
}
- // Let other modules act on deleting the object.
+ // Let other modules act on deleting the entity.
module_invoke_all('field_attach_delete', $entity_type, $entity);
if ($cacheable) {
@@ -962,20 +962,20 @@ function field_attach_delete($entity_type, $entity) {
}
/**
- * Delete field data for a single revision of an existing object. The
- * passed object must have a revision id attribute.
+ * Delete field data for a single revision of an existing entity. The
+ * passed entity must have a revision id attribute.
*
* @param $entity_type
* The type of $entity; e.g. 'node' or 'user'.
* @param $entity
- * The object with fields to save.
+ * The entity with fields to save.
*/
function field_attach_delete_revision($entity_type, $entity) {
_field_invoke('delete_revision', $entity_type, $entity);
list($id, $vid, $bundle, $cacheable) = entity_extract_ids($entity_type, $entity);
- // Collect the storage backends used by the fields in the objects.
+ // Collect the storage backends used by the fields in the entities.
$storages = array();
foreach (field_info_instances($entity_type, $bundle) as $instance) {
$field = field_info_field_by_id($instance['field_id']);
@@ -994,14 +994,14 @@ function field_attach_delete_revision($entity_type, $entity) {
}
/**
- * Retrieve objects matching a given set of conditions.
+ * Retrieve entities matching a given set of conditions.
*
* Note that the query 'conditions' only apply to the stored values.
* In a regular field_attach_load() call, field values additionally go through
* hook_field_load() and hook_field_attach_load() invocations, which can add
* to or affect the raw stored values. The results of field_attach_query()
* might therefore differ from what could be expected by looking at a regular,
- * fully loaded object.
+ * fully loaded entity.
*
* @param $field_id
* The id of the field to query.
@@ -1014,13 +1014,13 @@ function field_attach_delete_revision($entity_type, $entity) {
* Supported columns:
* - any of the columns defined in hook_field_schema() for $field_name's
* field type: condition on field value,
- * - 'type': condition on object type (e.g. 'node', 'user'...),
- * - 'bundle': condition on object bundle (e.g. node type),
- * - 'entity_id': condition on object id (e.g node nid, user uid...),
+ * - 'type': condition on entity type (e.g. 'node', 'user'...),
+ * - 'bundle': condition on entity bundle (e.g. node type),
+ * - 'entity_id': condition on entity id (e.g node nid, user uid...),
* - 'deleted': condition on whether the field's data is
- * marked deleted for the object (defaults to FALSE if not specified)
+ * marked deleted for the entity (defaults to FALSE if not specified)
* The field_attach_query_revisions() function additionally supports:
- * - 'revision_id': condition on object revision id (e.g node vid).
+ * - 'revision_id': condition on entity revision id (e.g node vid).
* Supported operators:
* - '=', '!=', '>', '>=', '<', '<=', 'STARTS_WITH', 'ENDS_WITH',
* 'CONTAINS': these operators expect the value as a literal of the same
@@ -1046,7 +1046,7 @@ function field_attach_delete_revision($entity_type, $entity) {
* - limit: The number of results that is requested. This is only a
* hint to the storage engine(s); callers should be prepared to
* handle fewer or more results. Specify FIELD_QUERY_NO_LIMIT to retrieve
- * all available objects. This option has a default value of 0 so
+ * all available entities. This option has a default value of 0 so
* callers must make an explicit choice to potentially retrieve an
* enormous result set.
* - cursor: A reference to an opaque cursor that allows a caller to
@@ -1056,18 +1056,18 @@ function field_attach_delete_revision($entity_type, $entity) {
* the value will be filled in with FIELD_QUERY_COMPLETE. If cursor
* is passed as NULL, the first result set is returned and no next
* cursor is returned.
- * - count: If TRUE, return a single count of all matching objects;
+ * - count: If TRUE, return a single count of all matching entities;
* limit and cursor are ignored.
* - age: Internal use only. Use field_attach_query_revisions()
* instead of passing FIELD_LOAD_REVISION.
* - FIELD_LOAD_CURRENT (default): query the most recent revisions for all
- * objects. The results will be keyed by object type and object id.
+ * entities. The results will be keyed by entity type and entity id.
* - FIELD_LOAD_REVISION: query all revisions. The results will be keyed by
- * object type and object revision id.
+ * entity type and entity revision id.
* @return
- * An array keyed by object type (e.g. 'node', 'user'...), then by object id
+ * An array keyed by entity type (e.g. 'node', 'user'...), then by entity id
* or revision id (depending of the value of the $age parameter).
- * The values are pseudo-objects with the bundle, id, and revision
+ * The values are pseudo-entities with the bundle, id, and revision
* id fields filled in.
*
* Throws a FieldQueryException if the field's storage doesn't support the
@@ -1105,7 +1105,7 @@ function field_attach_query($field_id, $conditions, $options = array()) {
}
/**
- * Retrieve object revisions matching a given set of conditions.
+ * Retrieve entity revisions matching a given set of conditions.
*
* See field_attach_query() for more informations.
*
@@ -1128,13 +1128,13 @@ function field_attach_query_revisions($field_id, $conditions, $options = array()
*
* This function must be called before field_attach_view(). It lets field
* types and formatters load additional data needed for display, and
- * therefore accepts an array of objects to allow query optimisation when
- * displaying lists of objects.
+ * therefore accepts an array of entities to allow query optimisation when
+ * displaying lists of entities.
*
* @param $entity_type
* The type of $entities; e.g. 'node' or 'user'.
* @param $entities
- * An array of objects, keyed by object id.
+ * An array of entities, keyed by entity id.
* @param $view_mode
* View mode, e.g. 'full', 'teaser'...
*/
@@ -1162,12 +1162,12 @@ function field_attach_prepare_view($entity_type, $entities, $view_mode = 'full')
}
/**
- * Returns a renderable array for the fields on an object.
+ * Returns a renderable array for the fields on an entity.
*
* Each field is displayed according to the display options specified in the
* $instance definition for the given $view_mode.
*
- * The object must have run through field_attach_prepare_view() beforehands.
+ * The entity must have run through field_attach_prepare_view() beforehands.
* @see field_attach_prepare_view()
*
* Sample structure:
@@ -1177,8 +1177,8 @@ function field_attach_prepare_view($entity_type, $entities, $view_mode = 'full')
* '#theme' => 'field',
* '#title' => the label of the field instance,
* '#label_display' => the label display mode,
- * '#object' => the fieldable object being displayed,
- * '#object_type' => the type of the object being displayed,
+ * '#object' => the fieldable entity being displayed,
+ * '#object_type' => the type of the entity being displayed,
* '#language' => the language of the field values being displayed,
* '#view_mode' => the view mode,
* '#field_name' => the name of the field,
@@ -1194,7 +1194,7 @@ function field_attach_prepare_view($entity_type, $entities, $view_mode = 'full')
* @param $entity_type
* The type of $entity; e.g. 'node' or 'user'.
* @param $entity
- * The object with fields to render.
+ * The entity with fields to render.
* @param $view_mode
* View mode, e.g. 'full', 'teaser'...
* @param $langcode
@@ -1228,7 +1228,7 @@ function field_attach_view($entity_type, $entity, $view_mode = 'full', $langcode
drupal_alter('field_attach_view', $output, $context);
// Reset the _field_view_prepared flag set in field_attach_prepare_view(),
- // in case the same object is displayed with different settings later in
+ // in case the same entity is displayed with different settings later in
// the request.
unset($entity->_field_view_prepared);
@@ -1246,7 +1246,7 @@ function field_attach_view($entity_type, $entity, $view_mode = 'full', $langcode
* @param $entity_type
* The type of $entity; e.g. 'node' or 'user'.
* @param $entity
- * The object with fields to render.
+ * The entity with fields to render.
* @param $element
* The structured array containing the values ready for rendering.
* @param $variables
@@ -1300,7 +1300,7 @@ function field_attach_prepare_translation($node) {
* others might.
*
* @param $entity_type
- * The object type to which the bundle is bound.
+ * The entity type to which the bundle is bound.
* @param $bundle
* The name of the newly created bundle.
*/
@@ -1316,7 +1316,7 @@ function field_attach_create_bundle($entity_type, $bundle) {
* Notify field.module that a bundle was renamed.
*
* @param $entity_type
- * The object type to which the bundle is bound.
+ * The entity type to which the bundle is bound.
* @param $bundle_old
* The previous name of the bundle.
* @param $bundle_new
@@ -1347,7 +1347,7 @@ function field_attach_rename_bundle($entity_type, $bundle_old, $bundle_new) {
* simple DELETE query).
*
* @param $entity_type
- * The object type to which the bundle is bound.
+ * The entity type to which the bundle is bound.
* @param $bundle
* The bundle to delete.
*/
diff --git a/modules/field/field.crud.inc b/modules/field/field.crud.inc
index cb2022dd4..976e1ffd3 100644
--- a/modules/field/field.crud.inc
+++ b/modules/field/field.crud.inc
@@ -13,7 +13,7 @@
*
* The Field API defines two primary data structures, Field and
* Instance, and the concept of a Bundle. A Field defines a
- * particular type of data that can be attached to objects. A Field
+ * particular type of data that can be attached to entities. A Field
* Instance is a Field attached to a single Bundle. A Bundle is a set
* of fields that are treated as a group by the Field Attach API and
* is related to a single fieldable entity type.
@@ -31,8 +31,8 @@
* field_attach_load() then loads the 'subtitle' and 'photo' fields
* because they are both attached to the 'node' bundle 'article'.
*
- * Field objects are (currently) represented as an array of key/value
- * pairs. The object properties are:
+ * Field definitions are (currently) represented as an array of key/value
+ * pairs. The array properties are:
*
* @param array $field:
* - id (integer, read-only)
@@ -40,7 +40,7 @@
* by field_create_field().
* - field_name (string)
* The name of the field. Each field name is unique within Field API.
- * When a field is attached to an object, the field's data is stored
+ * When a field is attached to an entity, the field's data is stored
* in $entity->$field_name.
* - type (string)
* The type of the field, such as 'text' or 'image'. Field types
@@ -96,8 +96,8 @@
* A sub-array of key/value pairs of settings. Each storage backend
* defines and documents its own settings.
*
- * Field Instance objects are (currently) represented as an array of
- * key/value pairs. The object properties are:
+ * Field Instance definitions are (currently) represented as an array of
+ * key/value pairs. The array properties are:
*
* @param array $instance:
* - id (integer, read-only)
@@ -109,7 +109,7 @@
* - field_name (string)
* The name of the field attached to the bundle by this instance.
* - object_type (string)
- * The name of the object type the instance is attached 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.
* - label (string)
@@ -147,7 +147,7 @@
* Each field widget type module defines and documents its own
* widget settings.
* - weight (float)
- * The weight of the widget relative to the other elements in object
+ * The weight of the widget relative to the other elements in entity
* edit forms.
* - module (string, read-only)
* The name of the module that implements the widget type.
@@ -166,7 +166,7 @@
* 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 object components
+ * 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.
@@ -259,7 +259,7 @@ function field_create_field($field) {
}
// Disallow reserved field names. This can't prevent all field name
- // collisions with existing object properties, but some is better
+ // collisions with existing entity properties, but some is better
// than none.
foreach (entity_get_info() as $type => $info) {
if (in_array($field['field_name'], $info['object keys'])) {
@@ -618,7 +618,7 @@ function field_create_instance($instance) {
if (empty($instance['bundle'])) {
throw new FieldException(t('Attempt to create an instance of field @field_name without a bundle.', array('@field_name' => $instance['field_name'])));
}
- // Check that the field can be attached to this object type.
+ // Check that the field can be attached to this entity type.
if (!empty($field['object_types']) && !in_array($instance['object_type'], $field['object_types'])) {
throw new FieldException(t('Attempt to create an instance of field @field_name on forbidden object type @obj_type.', array('@field_name' => $instance['field_name'], '@obj_type' => $instance['object_type'])));
}
@@ -632,7 +632,7 @@ function field_create_instance($instance) {
// TODO: Check that the widget type is known and can handle the field type ?
// TODO: Check that the formatters are known and can handle the field type ?
- // TODO: Check that the display view modes are known for the object type ?
+ // TODO: Check that the display view modes are known for the entity type ?
// Those checks should probably happen in _field_write_instance() ?
// Problem : this would mean that a UI module cannot update an instance with a disabled formatter.
@@ -787,7 +787,7 @@ function _field_write_instance($instance, $update = FALSE) {
* field_read_instances() instead for this purpose.
*
* @param $entity_type
- * The type of object to which the field is bound.
+ * The type of entity to which the field is bound.
* @param $field_name
* The field name to read.
* @param $bundle
@@ -848,7 +848,7 @@ function field_read_instances($params = array(), $include_additional = array())
$results = $query->execute();
foreach ($results as $record) {
- // Filter out instances on unknown object types (for instance because the
+ // Filter out instances on unknown entity types (for instance because the
// module exposing them was disabled).
$entity_info = entity_get_info($record['object_type']);
if ($include_inactive || $entity_info) {
@@ -902,29 +902,29 @@ function field_delete_instance($instance) {
* Clean up after Field API bulk deletion operations.
*
* Field API provides functions for deleting data attached to individual
- * objects as well as deleting entire fields or field instances in a single
+ * entities as well as deleting entire fields or field instances in a single
* operation.
*
- * Deleting field data items for an object with field_attach_delete() involves
+ * Deleting field data items for an entity with field_attach_delete() involves
* three separate operations:
* - Invoking the Field Type API hook_field_delete() for each field on the
- * object. The hook for each field type receives the object and the specific
+ * entity. The hook for each field type receives the entity and the specific
* field being deleted. A file field module might use this hook to delete
* uploaded files from the filesystem.
* - Invoking the Field Storage API hook_field_storage_delete() to remove
* data from the primary field storage. The hook implementation receives the
- * object being deleted and deletes data for all of the object's bundle's
+ * entity being deleted and deletes data for all of the entity's bundle's
* fields.
* - Invoking the global Field Attach API hook_field_attach_delete() for all
- * modules that implement it. Each hook implementation receives the object
- * being deleted and can operate on whichever subset of the object's bundle's
+ * modules that implement it. Each hook implementation receives the entity
+ * being deleted and can operate on whichever subset of the entity's bundle's
* fields it chooses to.
*
* These hooks are invoked immediately when field_attach_delete() is
* called. Similar operations are performed for field_attach_delete_revision().
*
* When a field, bundle, or field instance is deleted, it is not practical to
- * invoke these hooks immediately on every affected object in a single page
+ * invoke these hooks immediately on every affected entity in a single page
* request; there could be thousands or millions of them. Instead, the
* appropriate field data items, instances, and/or fields are marked as deleted
* so that subsequent load or query operations will not return them. Later, a
@@ -933,24 +933,24 @@ function field_delete_instance($instance) {
* deleted field and instance records.
*
* Purging field data is made somewhat tricky by the fact that, while
- * field_attach_delete() has a complete object to pass to the various deletion
+ * field_attach_delete() has a complete entity to pass to the various deletion
* hooks, the Field API purge process only has the field data it has previously
- * stored. It cannot reconstruct complete original objects to pass to the
- * deletion hooks. It is even possible that the original object to which some
+ * stored. It cannot reconstruct complete original entities to pass to the
+ * deletion hooks. It is even possible that the original entity to which some
* Field API data was attached has been itself deleted before the field purge
* operation takes place.
*
- * Field API resolves this problem by using "pseudo-objects" during purge
- * operations. A pseudo-object contains only the information from the original
- * object that Field API knows about: entity type, id, revision id, and
+ * Field API resolves this problem by using "pseudo-entities" during purge
+ * operations. A pseudo-entity contains only the information from the original
+ * entity that Field API knows about: entity type, id, revision id, and
* bundle. It also contains the field data for whichever field instance is
* currently being purged. For example, suppose that the node type 'story' used
* to contain a field called 'subtitle' but the field was deleted. If node 37
- * was a story with a subtitle, the pseudo-object passed to the purge hooks
+ * was a story with a subtitle, the pseudo-entity passed to the purge hooks
* would look something like this:
*
* @code
- * $obj = stdClass Object(
+ * $entity = stdClass Object(
* [nid] => 37,
* [vid] => 37,
* [type] => 'story',
@@ -967,7 +967,7 @@ function field_delete_instance($instance) {
* Purges a batch of deleted Field API data, instances, or fields.
*
* This function will purge deleted field data on up to a specified maximum
- * number of objects and then return. If a deleted field instance with no
+ * number of entities and then return. If a deleted field instance with no
* remaining data records is found, the instance itself will be purged.
* If a deleted field with no remaining field instances is found, the field
* itself will be purged.
@@ -983,7 +983,7 @@ function field_purge_batch($batch_size) {
foreach ($instances as $instance) {
$field = field_info_field_by_id($instance['field_id']);
- // Retrieve some pseudo-objects.
+ // Retrieve some pseudo-entities.
$entity_types = field_attach_query($instance['field_id'], array(array('bundle', $instance['bundle']), array('deleted', 1)), array('limit' => $batch_size));
if (count($entity_types) > 0) {
@@ -998,7 +998,7 @@ function field_purge_batch($batch_size) {
return;
}
- // Purge the data for the object.
+ // Purge the data for the entity.
field_purge_data($entity_type, $entity, $field, $instance);
}
}
@@ -1021,16 +1021,16 @@ function field_purge_batch($batch_size) {
}
/**
- * Purges the field data for a single field on a single pseudo-object.
+ * Purges the field data for a single field on a single pseudo-entity.
*
* This is basically the same as field_attach_delete() except it only applies
- * to a single field. The object itself is not being deleted, and it is quite
+ * to a single field. The entity itself is not being deleted, and it is quite
* possible that other field data will remain attached to it.
*
* @param $entity_type
* The type of $entity; e.g. 'node' or 'user'.
* @param $entity
- * The pseudo-object whose field data to delete.
+ * The pseudo-entity whose field data to delete.
* @param $field
* The (possibly deleted) field whose data is being purged.
* @param $instance
diff --git a/modules/field/field.default.inc b/modules/field/field.default.inc
index 6cdd160aa..4bdd2a83d 100644
--- a/modules/field/field.default.inc
+++ b/modules/field/field.default.inc
@@ -32,7 +32,7 @@ function field_default_extract_form_values($entity_type, $entity, $field, $insta
* @param $entity_type
* The type of $entity.
* @param $entity
- * The object for the operation.
+ * The entity for the operation.
* @param $field
* The field structure for the operation.
* @param $instance
@@ -43,7 +43,7 @@ function field_default_extract_form_values($entity_type, $entity, $field, $insta
* $entity->{$field['field_name']}[$langcode], or an empty array if unset.
* @param $errors
* The array of errors, keyed by field name and by value delta, that have
- * already been reported for the object. The function should add its errors
+ * already been reported for the entity. The function should add its errors
* to this array. Each error is an associative array, with the following
* keys and values:
* - 'error': an error code (should be a string, prefixed with the module name)
@@ -102,16 +102,16 @@ function field_default_insert($entity_type, $entity, $field, $instance, $langcod
* @param $entity_type
* The type of $entity; e.g. 'node' or 'user'.
* @param $entities
- * An array of objects being displayed, keyed by object id.
+ * An array of entities being displayed, keyed by entity id.
* @param $field
* The field structure for the operation.
* @param $instances
- * Array of instance structures for $field for each object, keyed by object
+ * Array of instance structures for $field for each entity, keyed by entity
* id.
* @param $langcode
* The language associated to $items.
* @param $items
- * Array of field values already loaded for the objects, keyed by object id.
+ * Array of field values already loaded for the entities, keyed by entity id.
* @param $display
* Can be either:
* - the name of a view mode
@@ -119,14 +119,14 @@ function field_default_insert($entity_type, $entity, $field, $instance, $langcod
* 'display' entry of $instance definitions.
*/
function field_default_prepare_view($entity_type, $entities, $field, $instances, $langcode, &$items, $display) {
- // Group objects, instances and items by formatter module.
+ // Group entities, instances and items by formatter module.
$modules = array();
foreach ($instances as $id => $instance) {
$display = is_string($display) ? $instance['display'][$display] : $display;
if ($display['type'] !== 'hidden') {
$module = $display['module'];
$modules[$module] = $module;
- $grouped_objects[$module][$id] = $entities[$id];
+ $grouped_entities[$module][$id] = $entities[$id];
$grouped_instances[$module][$id] = $instance;
$grouped_displays[$module][$id] = $display;
// hook_field_formatter_prepare_view() alters $items by reference.
@@ -138,7 +138,7 @@ function field_default_prepare_view($entity_type, $entities, $field, $instances,
// Invoke hook_field_formatter_prepare_view().
$function = $module . '_field_formatter_prepare_view';
if (function_exists($function)) {
- $function($entity_type, $grouped_objects[$module], $field, $grouped_instances[$module], $langcode, $grouped_items[$module], $grouped_displays[$module]);
+ $function($entity_type, $grouped_entities[$module], $field, $grouped_instances[$module], $langcode, $grouped_items[$module], $grouped_displays[$module]);
}
}
}
@@ -149,16 +149,16 @@ function field_default_prepare_view($entity_type, $entities, $field, $instances,
* @param $entity_type
* The type of $entity; e.g. 'node' or 'user'.
* @param $entities
- * An array of objects being displayed, keyed by object id.
+ * An array of entities being displayed, keyed by entity id.
* @param $field
* The field structure for the operation.
* @param $instances
- * Array of instance structures for $field for each object, keyed by object
+ * Array of instance structures for $field for each entity, keyed by entity
* id.
* @param $langcode
* The language associated to $items.
* @param $items
- * Array of field values already loaded for the objects, keyed by object id.
+ * Array of field values already loaded for the entities, keyed by entity id.
* @param $display
* Can be either:
* - the name of a view mode;
diff --git a/modules/field/field.form.inc b/modules/field/field.form.inc
index 6b7c1ca13..a37343b1e 100644
--- a/modules/field/field.form.inc
+++ b/modules/field/field.form.inc
@@ -10,7 +10,7 @@
* Create a separate form element for each field.
*/
function field_default_form($entity_type, $entity, $field, $instance, $langcode, $items, &$form, &$form_state, $get_delta = NULL) {
- // This could be called with no object, as when a UI module creates a
+ // This could be called with no entity, as when a UI module creates a
// dummy form to set default values.
if ($entity) {
list($id, , ) = entity_extract_ids($entity_type, $entity);
@@ -29,7 +29,7 @@ function field_default_form($entity_type, $entity, $field, $instance, $langcode,
'errors' => array(),
);
- // Populate widgets with default values when creating a new object.
+ // Populate widgets with default values when creating a new entity.
if (empty($items) && empty($id)) {
$items = field_get_default_value($entity_type, $entity, $field, $instance, $langcode);
}
diff --git a/modules/field/field.info b/modules/field/field.info
index e136b4a66..97ce7d7d8 100644
--- a/modules/field/field.info
+++ b/modules/field/field.info
@@ -1,6 +1,6 @@
; $Id$
name = Field
-description = Field API to add fields to objects like nodes and users.
+description = Field API to add fields to entities like nodes and users.
package = Core - fields
version = VERSION
core = 7.x
diff --git a/modules/field/field.info.inc b/modules/field/field.info.inc
index b0358f0ad..5e72b9339 100644
--- a/modules/field/field.info.inc
+++ b/modules/field/field.info.inc
@@ -168,7 +168,7 @@ function _field_info_collate_types($reset = FALSE) {
* - fields_id: Array of existing fields, keyed by field id. This entry lists
* both deleted and non-deleted fields. The bundles element is the same as
* for 'fields'.
- * - instances: Array of existing instances, keyed by object type, bundle
+ * - instances: Array of existing instances, keyed by entity type, bundle
* name and field name. This entry only lists non-deleted instances.
*/
function _field_info_collate_fields($reset = FALSE) {
@@ -482,12 +482,12 @@ function field_info_storage_types($storage_type = NULL) {
* Returns information about existing bundles.
*
* @param $entity_type
- * The type of object; e.g. 'node' or 'user'.
+ * The type of entity; e.g. 'node' or 'user'.
*
* @return
* An array of bundles for the $entity_type keyed by bundle name,
* or, if no $entity_type was provided, the array of all existing bundles,
- * keyed by object type.
+ * keyed by entity type.
*/
function field_info_bundles($entity_type = NULL) {
$info = entity_get_info();
@@ -562,13 +562,13 @@ function field_info_field_by_id($field_id) {
* Retrieves information about field instances.
*
* @param $entity_type
- * The object type for which to return instances.
+ * The entity type for which to return instances.
* @param $bundle_name
* The bundle name for which to return instances.
*
* @return
- * If $entity_type is not set, return all instances keyed by object type and
- * bundle name. If $entity_type is set, return all instances for that object
+ * 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
* type, keyed by bundle name. If $entity_type and $bundle_name are set, return
* all instances for that bundle.
*/
@@ -590,7 +590,7 @@ function field_info_instances($entity_type = NULL, $bundle_name = NULL) {
* Returns an array of instance data for a specific field and bundle.
*
* @param $entity_type
- * The object type for the instance.
+ * The entity type for the instance.
* @param $field_name
* The field name for the instance.
* @param $bundle_name
diff --git a/modules/field/field.module b/modules/field/field.module
index 374a83231..50674136d 100644
--- a/modules/field/field.module
+++ b/modules/field/field.module
@@ -2,7 +2,7 @@
// $Id$
/**
* @file
- * Attach custom data fields to Drupal objects.
+ * Attach custom data fields to Drupal entities.
*/
/*
@@ -20,11 +20,11 @@ require_once DRUPAL_ROOT . '/modules/field/field.form.inc';
/**
* @defgroup field Field API
* @{
- * Attach custom data fields to Drupal objects.
+ * Attach custom data fields to Drupal entities.
*
* The Field API allows custom data fields to be attached to Drupal
- * objects and takes care of storing, loading, editing, and rendering
- * field data. Any object type (node, user, etc.) can use the Field
+ * entities and takes care of storing, loading, editing, and rendering
+ * field data. Any entity type (node, user, etc.) can use the Field
* API to make itself "fieldable" and thus allow fields to be attached
* to it. Other modules can provide a user interface for managing custom
* fields via a web browser as well as a wide and flexible variety of
@@ -42,11 +42,11 @@ require_once DRUPAL_ROOT . '/modules/field/field.form.inc';
* Modules use this API, often in hook_install(), to create
* custom data structures.
*
- * - @link field_attach Field Attach API @endlink. Connects object
+ * - @link field_attach Field Attach API @endlink. Connects entity
* types to the Field API. Field Attach API functions load, store,
* generate Form API structures, display, and perform a variety of
- * other functions for field data connected to individual objects.
- * Fieldable object types like node and user use this API to make
+ * other functions for field data connected to individual entities.
+ * Fieldable entity types like node and user use this API to make
* themselves fieldable.
*
* - @link field_info Field Info API @endlink. Exposes information
@@ -83,13 +83,13 @@ define('FIELD_BEHAVIOR_DEFAULT', 0x0002);
define('FIELD_BEHAVIOR_CUSTOM', 0x0004);
/**
- * Age argument for loading the most recent version of an object's
+ * Age argument for loading the most recent version of an entity's
* field data with field_attach_load().
*/
define('FIELD_LOAD_CURRENT', 'FIELD_LOAD_CURRENT');
/**
- * Age argument for loading the version of an object's field data
- * specified in the object with field_attach_load().
+ * Age argument for loading the version of an entity's field data
+ * specified in the entity with field_attach_load().
*/
define('FIELD_LOAD_REVISION', 'FIELD_LOAD_REVISION');
@@ -101,7 +101,7 @@ define('FIELD_LOAD_REVISION', 'FIELD_LOAD_REVISION');
/**
* Limit argument for field_attach_query() to request all available
- * objects instead of a limited number.
+ * entities instead of a limited number.
*/
define('FIELD_QUERY_NO_LIMIT', 'FIELD_QUERY_NO_LIMIT');
@@ -143,7 +143,7 @@ function field_help($path, $arg) {
case 'admin/help#field':
$output = '';
$output .= '<h3>' . t('About') . '</h3>';
- $output .= '<p>' . t('The Field module allows custom data fields to be attached to Drupal <em>objects</em> (content nodes, users, taxonomy vocabularies, etc.) and takes care of storing, loading, editing, and rendering field data. Most users will not interact with the Field module directly, but will instead use the <a href="@field-ui-help">Field UI module</a> user interface. Module developers can use the Field API to make new objects "fieldable" and thus allow fields to be attached to their objects. For more information, see the online handbook entry for <a href="@field">Field module</a>.', array('@field-ui-help' => url('admin/help/field_ui'), '@field' => 'http://drupal.org/handbook/modules/field')) . '</p>';
+ $output .= '<p>' . t('The Field module allows custom data fields to be attached to Drupal <em>entities</em> (content nodes, users, taxonomy vocabularies, etc.) and takes care of storing, loading, editing, and rendering field data. Most users will not interact with the Field module directly, but will instead use the <a href="@field-ui-help">Field UI module</a> user interface. Module developers can use the Field API to make new entities "fieldable" and thus allow fields to be attached to their entities. For more information, see the online handbook entry for <a href="@field">Field module</a>.', array('@field-ui-help' => url('admin/help/field_ui'), '@field' => 'http://drupal.org/handbook/modules/field')) . '</p>';
$output .= '<h3>' . t('Uses') . '</h3>';
$output .= '<dl>';
$output .= '<dt>' . t('Enabling field types') . '</dt>';
@@ -272,12 +272,12 @@ function field_associate_fields($module) {
}
/**
- * Helper function to get the default value for a field on an object.
+ * Helper function to get the default value for a field on an entity.
*
* @param $entity_type
* The type of $entity; e.g. 'node' or 'user'.
* @param $entity
- * The object for the operation.
+ * The entity for the operation.
* @param $field
* The field structure.
* @param $instance
@@ -381,7 +381,7 @@ function field_extra_fields($entity_type, $bundle) {
$info = (array) module_invoke_all('field_extra_fields');
drupal_alter('field_extra_fields', $info);
- // Add saved weights. The array is keyed by object type, bundle and
+ // Add saved weights. The array is keyed by entity type, bundle and
// element name.
$extra_weights = variable_get('field_extra_weights', array());
foreach ($extra_weights as $entity_type_name => $bundles) {
@@ -419,7 +419,7 @@ function field_extra_field_weight($entity_type, $bundle, $pseudo_field) {
}
/**
- * Pre-render callback to adjust weights of non-field elements on objects.
+ * Pre-render callback to adjust weights of non-field elements on entities.
*/
function _field_extra_weights_pre_render($elements) {
if (isset($elements['#extra_fields'])) {
@@ -566,7 +566,7 @@ function field_format($entity_type, $entity, $field, $item, $formatter_type = NU
}
/**
- * Returns a renderable array for the value of a single field in an object.
+ * Returns a renderable array for the value of a single field in an entity.
*
* The resulting output is a fully themed field with label and multiple values.
*
@@ -574,7 +574,7 @@ function field_format($entity_type, $entity, $field, $item, $formatter_type = NU
* isolated field.
* - Do not use inside node (or other entities) templates, use
* render($content[FIELD_NAME]) instead.
- * - Do not use to display all fields in an object, use
+ * - Do not use to display all fields in an entity, use
* field_attach_prepare_view() and field_attach_view() instead.
*
* The function takes care of invoking the prepare_view steps. It also respects
@@ -583,7 +583,7 @@ function field_format($entity_type, $entity, $field, $item, $formatter_type = NU
* @param $entity_type
* The type of $entity; e.g. 'node' or 'user'.
* @param $entity
- * The object containing the field to display. Must at least contain the id
+ * The entity containing the field to display. Must at least contain the id
* key and the field data to display.
* @param $field_name
* The name of the field to display.
@@ -591,7 +591,7 @@ function field_format($entity_type, $entity, $field, $item, $formatter_type = NU
* Can be either:
* - The name of a view mode. The field will be displayed according to the
* display settings specified for this view mode in the $instance
- * definition for the field in the object's bundle.
+ * definition for the field in the entity's bundle.
* If no display settings are found for the view mode, the settings for
* the 'full' view mode will be used.
* - An array of display settings, as found in the 'display' entry of
@@ -672,7 +672,7 @@ function field_view_field($entity_type, $entity, $field_name, $display = array()
* @param $field
* A field structure.
* @return
- * TRUE if the field has data for any object; FALSE otherwise.
+ * TRUE if the field has data for any entity; FALSE otherwise.
*/
function field_has_data($field) {
$results = field_attach_query($field['id'], array(), array('limit' => 1));
@@ -691,7 +691,7 @@ function field_has_data($field) {
* @param $entity_type
* The type of $entity; e.g. 'node' or 'user'.
* @param $entity
- * (optional) The object for the operation.
+ * (optional) The entity for the operation.
* @param $account
* (optional) The account to check, if not given use currently logged in user.
* @return
@@ -721,7 +721,7 @@ function field_access($op, $field, $entity_type, $entity = NULL, $account = NULL
* @param $entity_type
* The type of $entity; e.g. 'node' or 'user'.
* @param $bundle
- * The bundle object (or string if bundles for this object type do not exist
+ * The bundle object (or string if bundles for this entity type do not exist
* as standalone objects).
* @return
* The bundle name.
diff --git a/modules/field/field.multilingual.inc b/modules/field/field.multilingual.inc
index 1f0f587eb..f976bbe44 100644
--- a/modules/field/field.multilingual.inc
+++ b/modules/field/field.multilingual.inc
@@ -95,13 +95,13 @@ function field_multilingual_content_languages() {
* TRUE, if the handler is allowed to manage field translations.
*/
function field_multilingual_check_translation_handlers($entity_type, $handler = NULL) {
- $obj_info = entity_get_info($entity_type);
+ $entity_info = entity_get_info($entity_type);
if (isset($handler)) {
- return isset($obj_info['translation'][$handler]) && !empty($obj_info['translation'][$handler]);
+ return isset($entity_info['translation'][$handler]) && !empty($entity_info['translation'][$handler]);
}
- elseif (isset($obj_info['translation'])) {
- foreach ($obj_info['translation'] as $handler_info) {
+ elseif (isset($entity_info['translation'])) {
+ foreach ($entity_info['translation'] as $handler_info) {
// The translation handler must use a non-empty data structure.
if (!empty($handler_info)) {
return TRUE;
diff --git a/modules/field/modules/field_sql_storage/field_sql_storage.module b/modules/field/modules/field_sql_storage/field_sql_storage.module
index 46a00e8d9..841337b10 100644
--- a/modules/field/modules/field_sql_storage/field_sql_storage.module
+++ b/modules/field/modules/field_sql_storage/field_sql_storage.module
@@ -86,14 +86,13 @@ function _field_sql_storage_indexname($name, $index) {
}
/**
- * Retrieve or assign an entity type id for an object type.
+ * Retrieve or assign an entity type id for an entity type.
*
* @param $entity_type
- * The object type, such as 'node' or 'user'.
+ * The entity type, such as 'node' or 'user'.
* @return
* The entity type id.
*
- * TODO: We need to decide on 'entity' or 'object'.
*/
function _field_sql_storage_etid($entity_type) {
$etid = variable_get('field_sql_storage_' . $entity_type . '_etid', NULL);
@@ -434,7 +433,7 @@ function field_sql_storage_field_storage_write($entity_type, $entity, $op, $fiel
/**
* Implements hook_field_storage_delete().
*
- * This function deletes data for all fields for an object from the database.
+ * This function deletes data for all fields for an entity from the database.
*/
function field_sql_storage_field_storage_delete($entity_type, $entity, $fields) {
list($id, $vid, $bundle) = entity_extract_ids($entity_type, $entity);
@@ -452,7 +451,7 @@ function field_sql_storage_field_storage_delete($entity_type, $entity, $fields)
* Implements hook_field_storage_purge().
*
* This function deletes data from the database for a single field on
- * an object.
+ * an entity.
*/
function field_sql_storage_field_storage_purge($entity_type, $entity, $field, $instance) {
list($id, $vid, $bundle) = entity_extract_ids($entity_type, $entity);
@@ -548,7 +547,7 @@ function field_sql_storage_field_storage_query($field_id, $conditions, $options)
$query
->fields('t', array('bundle', 'entity_id', 'revision_id'))
->fields('e', array('type'))
- // We need to ensure objects arrive in a consistent order for the
+ // We need to ensure entities arrive in a consistent order for the
// range() operation to work.
->orderBy('t.etid')
->orderBy('t.entity_id');
@@ -556,11 +555,11 @@ function field_sql_storage_field_storage_query($field_id, $conditions, $options)
// Initialize results array
$return = array();
- // Getting $count objects possibly requires reading more than $count rows
+ // Getting $count entities possibly requires reading more than $count rows
// since fields with multiple values span over several rows. We query for
- // batches of $count rows until we've either read $count objects or received
+ // batches of $count rows until we've either read $count entities or received
// less rows than asked for.
- $obj_count = 0;
+ $entity_count = 0;
do {
if ($options['limit'] != FIELD_QUERY_NO_LIMIT) {
$query->range($options['cursor'], $options['limit']);
@@ -578,10 +577,10 @@ function field_sql_storage_field_storage_query($field_id, $conditions, $options)
if (!isset($return[$row->type][$id])) {
$return[$row->type][$id] = entity_create_stub_entity($row->type, array($row->entity_id, $row->revision_id, $row->bundle));
- $obj_count++;
+ $entity_count++;
}
}
- } while ($options['limit'] != FIELD_QUERY_NO_LIMIT && $row_count == $options['limit'] && $obj_count < $options['limit']);
+ } while ($options['limit'] != FIELD_QUERY_NO_LIMIT && $row_count == $options['limit'] && $entity_count < $options['limit']);
// The query is complete when the last batch returns less rows than asked
// for.
diff --git a/modules/field/modules/text/text.test b/modules/field/modules/text/text.test
index 3636c2a8d..e098b3f8c 100644
--- a/modules/field/modules/text/text.test
+++ b/modules/field/modules/text/text.test
@@ -114,7 +114,7 @@ class TextFieldTestCase extends DrupalWebTestCase {
$id = $match[1];
$this->assertRaw(t('test_entity @id has been created.', array('@id' => $id)), t('Entity was created'));
- // Display the object.
+ // Display the entity.
$entity = field_test_entity_test_load($id);
$entity->content = field_attach_view($entity_type, $entity);
$this->content = drupal_render($entity->content);
@@ -178,7 +178,7 @@ class TextFieldTestCase extends DrupalWebTestCase {
$id = $match[1];
$this->assertRaw(t('test_entity @id has been created.', array('@id' => $id)), t('Entity was created'));
- // Display the object.
+ // Display the entity.
$entity = field_test_entity_test_load($id);
$entity->content = field_attach_view($entity_type, $entity);
$this->content = drupal_render($entity->content);
@@ -211,7 +211,7 @@ class TextFieldTestCase extends DrupalWebTestCase {
$this->drupalPost(NULL, $edit, t('Save'));
$this->assertRaw(t('test_entity @id has been updated.', array('@id' => $id)), t('Entity was updated'));
- // Display the object.
+ // Display the entity.
$entity = field_test_entity_test_load($id);
$entity->content = field_attach_view($entity_type, $entity);
$this->content = drupal_render($entity->content);
diff --git a/modules/field/tests/field.test b/modules/field/tests/field.test
index c65a9b8e6..7468653b1 100644
--- a/modules/field/tests/field.test
+++ b/modules/field/tests/field.test
@@ -482,7 +482,7 @@ class FieldAttachStorageTestCase extends FieldAttachTestCase {
foreach (array_keys($rev) as $vid) {
$read = field_test_create_stub_entity(0, $vid, $this->instance['bundle']);
field_attach_load_revision($entity_type, array(0 => $read));
- $this->assertEqual(count($read->{$this->field_name}[$langcode]), $this->field['cardinality'], "The test object revision $vid has {$this->field['cardinality']} values.");
+ $this->assertEqual(count($read->{$this->field_name}[$langcode]), $this->field['cardinality'], "The test entity revision $vid has {$this->field['cardinality']} values.");
}
// Delete revision 1, confirm the other two still load.
@@ -490,24 +490,24 @@ class FieldAttachStorageTestCase extends FieldAttachTestCase {
foreach (array(0, 2) as $vid) {
$read = field_test_create_stub_entity(0, $vid, $this->instance['bundle']);
field_attach_load_revision($entity_type, array(0 => $read));
- $this->assertEqual(count($read->{$this->field_name}[$langcode]), $this->field['cardinality'], "The test object revision $vid has {$this->field['cardinality']} values.");
+ $this->assertEqual(count($read->{$this->field_name}[$langcode]), $this->field['cardinality'], "The test entity revision $vid has {$this->field['cardinality']} values.");
}
// Confirm the current revision still loads
$read = field_test_create_stub_entity(0, 2, $this->instance['bundle']);
field_attach_load($entity_type, array(0 => $read));
- $this->assertEqual(count($read->{$this->field_name}[$langcode]), $this->field['cardinality'], "The test object current revision has {$this->field['cardinality']} values.");
+ $this->assertEqual(count($read->{$this->field_name}[$langcode]), $this->field['cardinality'], "The test entity current revision has {$this->field['cardinality']} values.");
// Delete all field data, confirm nothing loads
field_attach_delete($entity_type, $rev[2]);
foreach (array(0, 1, 2) as $vid) {
$read = field_test_create_stub_entity(0, $vid, $this->instance['bundle']);
field_attach_load_revision($entity_type, array(0 => $read));
- $this->assertIdentical($read->{$this->field_name}, array(), "The test object revision $vid is deleted.");
+ $this->assertIdentical($read->{$this->field_name}, array(), "The test entity revision $vid is deleted.");
}
$read = field_test_create_stub_entity(0, 2, $this->instance['bundle']);
field_attach_load($entity_type, array(0 => $read));
- $this->assertIdentical($read->{$this->field_name}, array(), t('The test object current revision is deleted.'));
+ $this->assertIdentical($read->{$this->field_name}, array(), t('The test entity current revision is deleted.'));
}
/**
@@ -523,7 +523,7 @@ class FieldAttachStorageTestCase extends FieldAttachTestCase {
$this->instance['bundle'] = $new_bundle;
field_create_instance($this->instance);
- // Save an object with data in the field.
+ // Save an entity with data in the field.
$entity = field_test_create_stub_entity(0, 0, $this->instance['bundle']);
$langcode = LANGUAGE_NONE;
$values = $this->_generateTestFieldValues($this->field['cardinality']);
@@ -582,7 +582,7 @@ class FieldAttachStorageTestCase extends FieldAttachTestCase {
'size' => mt_rand(0, 255))));
field_create_instance($instance);
- // Save an object with data for both fields
+ // Save an entity with data for both fields
$entity = field_test_create_stub_entity(0, 0, $this->instance['bundle']);
$langcode = LANGUAGE_NONE;
$values = $this->_generateTestFieldValues($this->field['cardinality']);
@@ -634,13 +634,13 @@ class FieldAttachStorageTestCase extends FieldAttachTestCase {
// Unconditional count query returns 0.
$count = field_attach_query($this->field_id, array(), array('count' => TRUE));
- $this->assertEqual($count, 0, t('With no objects, count query returns 0.'));
+ $this->assertEqual($count, 0, t('With no entities, count query returns 0.'));
- // Create two test objects, using two different types and bundles.
+ // Create two test entities, using two different types and bundles.
$entity_types = array(1 => 'test_entity', 2 => 'test_cacheable_entity');
$entities = array(1 => field_test_create_stub_entity(1, 1, 'test_bundle'), 2 => field_test_create_stub_entity(2, 2, 'test_bundle_1'));
- // Create first test object with random (distinct) values.
+ // Create first test entity with random (distinct) values.
$values = array();
for ($delta = 0; $delta < $cardinality; $delta++) {
do {
@@ -653,59 +653,59 @@ class FieldAttachStorageTestCase extends FieldAttachTestCase {
// Unconditional count query returns 1.
$count = field_attach_query($this->field_id, array(), array('count' => TRUE));
- $this->assertEqual($count, 1, t('With one object, count query returns @count.', array('@count' => $count)));
+ $this->assertEqual($count, 1, t('With one entity, count query returns @count.', array('@count' => $count)));
- // Create second test object, sharing a value with the first one.
+ // Create second test entity, sharing a value with the first one.
$common_value = $values[$cardinality - 1];
$entities[2]->{$this->field_name} = array($langcode => array(array('value' => $common_value)));
field_attach_insert($entity_types[2], $entities[2]);
- // Query on the object's values.
+ // Query on the entity's values.
for ($delta = 0; $delta < $cardinality; $delta++) {
$conditions = array(array('value', $values[$delta]));
$result = field_attach_query($this->field_id, $conditions, array('limit' => FIELD_QUERY_NO_LIMIT));
- $this->assertTrue(isset($result[$entity_types[1]][1]), t('Query on value %delta returns the object', array('%delta' => $delta)));
+ $this->assertTrue(isset($result[$entity_types[1]][1]), t('Query on value %delta returns the entity', array('%delta' => $delta)));
$count = field_attach_query($this->field_id, $conditions, array('count' => TRUE));
- $this->assertEqual($count, ($values[$delta] == $common_value) ? 2 : 1, t('Count query on value %delta counts %count objects', array('%delta' => $delta, '%count' => $count)));
+ $this->assertEqual($count, ($values[$delta] == $common_value) ? 2 : 1, t('Count query on value %delta counts %count entities', array('%delta' => $delta, '%count' => $count)));
}
- // Query on a value that is not in the object.
+ // Query on a value that is not in the entity.
do {
$different_value = mt_rand(1, 127);
} while (in_array($different_value, $values));
$conditions = array(array('value', $different_value));
$result = field_attach_query($this->field_id, $conditions, array('limit' => FIELD_QUERY_NO_LIMIT));
- $this->assertFalse(isset($result[$entity_types[1]][1]), t("Query on a value that is not in the object doesn't return the object"));
+ $this->assertFalse(isset($result[$entity_types[1]][1]), t("Query on a value that is not in the entity doesn't return the entity"));
$count = field_attach_query($this->field_id, $conditions, array('count' => TRUE));
- $this->assertEqual($count, 0, t("Count query on a value that is not in the object doesn't count the object"));
+ $this->assertEqual($count, 0, t("Count query on a value that is not in the entity doesn't count the entity"));
- // Query on the value shared by both objects, and discriminate using
+ // Query on the value shared by both entities, and discriminate using
// additional conditions.
$conditions = array(array('value', $common_value));
$result = field_attach_query($this->field_id, $conditions, array('limit' => FIELD_QUERY_NO_LIMIT));
- $this->assertTrue(isset($result[$entity_types[1]][1]) && isset($result[$entity_types[2]][2]), t('Query on a value common to both objects returns both objects'));
+ $this->assertTrue(isset($result[$entity_types[1]][1]) && isset($result[$entity_types[2]][2]), t('Query on a value common to both entities returns both entities'));
$count = field_attach_query($this->field_id, $conditions, array('count' => TRUE));
- $this->assertEqual($count, 2, t('Count query on a value common to both objects counts both objects'));
+ $this->assertEqual($count, 2, t('Count query on a value common to both entities counts both entities'));
$conditions = array(array('type', $entity_types[1]), array('value', $common_value));
$result = field_attach_query($this->field_id, $conditions, array('limit' => FIELD_QUERY_NO_LIMIT));
- $this->assertTrue(isset($result[$entity_types[1]][1]) && !isset($result[$entity_types[2]][2]), t("Query on a value common to both objects and a 'type' condition only returns the relevant object"));
+ $this->assertTrue(isset($result[$entity_types[1]][1]) && !isset($result[$entity_types[2]][2]), t("Query on a value common to both entities and a 'type' condition only returns the relevant entity"));
$count = field_attach_query($this->field_id, $conditions, array('count' => TRUE));
- $this->assertEqual($count, 1, t("Count query on a value common to both objects and a 'type' condition only returns the relevant object"));
+ $this->assertEqual($count, 1, t("Count query on a value common to both entities and a 'type' condition only returns the relevant entity"));
$conditions = array(array('bundle', $entities[1]->fttype), array('value', $common_value));
$result = field_attach_query($this->field_id, $conditions, array('limit' => FIELD_QUERY_NO_LIMIT));
- $this->assertTrue(isset($result[$entity_types[1]][1]) && !isset($result[$entity_types[2]][2]), t("Query on a value common to both objects and a 'bundle' condition only returns the relevant object"));
+ $this->assertTrue(isset($result[$entity_types[1]][1]) && !isset($result[$entity_types[2]][2]), t("Query on a value common to both entities and a 'bundle' condition only returns the relevant entity"));
$count = field_attach_query($this->field_id, $conditions, array('count' => TRUE));
- $this->assertEqual($count, 1, t("Count query on a value common to both objects and a 'bundle' condition only counts the relevant object"));
+ $this->assertEqual($count, 1, t("Count query on a value common to both entities and a 'bundle' condition only counts the relevant entity"));
$conditions = array(array('entity_id', $entities[1]->ftid), array('value', $common_value));
$result = field_attach_query($this->field_id, $conditions, array('limit' => FIELD_QUERY_NO_LIMIT));
- $this->assertTrue(isset($result[$entity_types[1]][1]) && !isset($result[$entity_types[2]][2]), t("Query on a value common to both objects and an 'entity_id' condition only returns the relevant object"));
+ $this->assertTrue(isset($result[$entity_types[1]][1]) && !isset($result[$entity_types[2]][2]), t("Query on a value common to both entities and an 'entity_id' condition only returns the relevant entity"));
$count = field_attach_query($this->field_id, $conditions, array('count' => TRUE));
- $this->assertEqual($count, 1, t("Count query on a value common to both objects and an 'entity_id' condition only counts the relevant object"));
+ $this->assertEqual($count, 1, t("Count query on a value common to both entities and an 'entity_id' condition only counts the relevant entity"));
// Test result format.
$conditions = array(array('value', $values[0]));
@@ -725,7 +725,7 @@ class FieldAttachStorageTestCase extends FieldAttachTestCase {
$this->instance2['bundle'] = 'offset_bundle';
field_create_instance($this->instance2);
- // Create 20 test objects, using the new bundle, but with
+ // Create 20 test entities, using the new bundle, but with
// non-sequential ids so we can tell we are getting the right ones
// back. We do not need unique values since field_attach_query()
// won't return them anyway.
@@ -764,7 +764,7 @@ class FieldAttachStorageTestCase extends FieldAttachTestCase {
function testFieldAttachQueryRevisions() {
$cardinality = $this->field['cardinality'];
- // Create first object revision with random (distinct) values.
+ // Create first entity revision with random (distinct) values.
$entity_type = 'test_entity';
$entities = array(1 => field_test_create_stub_entity(1, 1), 2 => field_test_create_stub_entity(1, 2));
$langcode = LANGUAGE_NONE;
@@ -778,36 +778,36 @@ class FieldAttachStorageTestCase extends FieldAttachTestCase {
}
field_attach_insert($entity_type, $entities[1]);
- // Create second object revision, sharing a value with the first one.
+ // Create second entity revision, sharing a value with the first one.
$common_value = $values[$cardinality - 1];
$entities[2]->{$this->field_name}[$langcode][0] = array('value' => $common_value);
field_attach_update($entity_type, $entities[2]);
- // Query on the object's values.
+ // Query on the entity values.
for ($delta = 0; $delta < $cardinality; $delta++) {
$conditions = array(array('value', $values[$delta]));
$result = field_attach_query_revisions($this->field_id, $conditions, array('limit' => FIELD_QUERY_NO_LIMIT));
- $this->assertTrue(isset($result[$entity_type][1]), t('Query on value %delta returns the object', array('%delta' => $delta)));
+ $this->assertTrue(isset($result[$entity_type][1]), t('Query on value %delta returns the entity', array('%delta' => $delta)));
}
- // Query on a value that is not in the object.
+ // Query on a value that is not in the entity.
do {
$different_value = mt_rand(1, 127);
} while (in_array($different_value, $values));
$conditions = array(array('value', $different_value));
$result = field_attach_query_revisions($this->field_id, $conditions, array('limit' => FIELD_QUERY_NO_LIMIT));
- $this->assertFalse(isset($result[$entity_type][1]), t("Query on a value that is not in the object doesn't return the object"));
+ $this->assertFalse(isset($result[$entity_type][1]), t("Query on a value that is not in the entity doesn't return the entity"));
- // Query on the value shared by both objects, and discriminate using
+ // Query on the value shared by both entities, and discriminate using
// additional conditions.
$conditions = array(array('value', $common_value));
$result = field_attach_query_revisions($this->field_id, $conditions, array('limit' => FIELD_QUERY_NO_LIMIT));
- $this->assertTrue(isset($result[$entity_type][1]) && isset($result[$entity_type][2]), t('Query on a value common to both objects returns both objects'));
+ $this->assertTrue(isset($result[$entity_type][1]) && isset($result[$entity_type][2]), t('Query on a value common to both entities returns both entities'));
$conditions = array(array('revision_id', $entities[1]->ftvid), array('value', $common_value));
$result = field_attach_query_revisions($this->field_id, $conditions, array('limit' => FIELD_QUERY_NO_LIMIT));
- $this->assertTrue(isset($result[$entity_type][1]) && !isset($result[$entity_type][2]), t("Query on a value common to both objects and a 'revision_id' condition only returns the relevant object"));
+ $this->assertTrue(isset($result[$entity_type][1]) && !isset($result[$entity_type][2]), t("Query on a value common to both entities and a 'revision_id' condition only returns the relevant entity"));
// Test FIELD_QUERY_RETURN_IDS result format.
$conditions = array(array('value', $values[0]));
@@ -1351,10 +1351,10 @@ class FieldInfoTestCase extends FieldTestCase {
}
/**
- * Test that instances on disabled object types are filtered out.
+ * Test that instances on disabled entity types are filtered out.
*/
- function testInstanceDisabledObjectType() {
- // For this test the field type and the object type must be exposed by
+ function testInstanceDisabledEntityType() {
+ // For this test the field type and the entity type must be exposed by
// different modules.
$field_definition = array(
'field_name' => 'field',
@@ -1370,7 +1370,7 @@ class FieldInfoTestCase extends FieldTestCase {
// Disable coment module. This clears field_info cache.
module_disable(array('comment'));
- $this->assertNull(field_info_instance('comment', 'field', 'comment_node_article'), t('No instances are returned on disabled object types.'));
+ $this->assertNull(field_info_instance('comment', 'field', 'comment_node_article'), t('No instances are returned on disabled entity types.'));
}
/**
@@ -1979,18 +1979,18 @@ class FieldCrudTestCase extends FieldTestCase {
$this->pass(t('Cannot create a field with a name longer than 32 characters.'));
}
- // Check that field name can not be an object key.
- // "ftvid" is known as an object key from the "test_entity" type.
+ // Check that field name can not be an entity key.
+ // "ftvid" is known as an entity key from the "test_entity" type.
try {
$field_definition = array(
'type' => 'test_field',
'field_name' => 'ftvid',
);
$field = field_create_field($field_definition);
- $this->fail(t('Cannot create a field bearing the name of an object key.'));
+ $this->fail(t('Cannot create a field bearing the name of an entity key.'));
}
catch (FieldException $e) {
- $this->pass(t('Cannot create a field bearing the name of an object key.'));
+ $this->pass(t('Cannot create a field bearing the name of an entity key.'));
}
}
@@ -2142,7 +2142,7 @@ class FieldCrudTestCase extends FieldTestCase {
$instance = field_read_instance('test_entity', $this->instance_definition['field_name'], $this->instance_definition['bundle']);
$this->assertTrue(!empty($instance) && empty($instance['deleted']), t('A new instance for a previously used field name is created.'));
- // Save an object with data for the field
+ // Save an entity with data for the field
$entity = field_test_create_stub_entity(0, 0, $instance['bundle']);
$langcode = LANGUAGE_NONE;
$values[0]['value'] = mt_rand(1, 127);
@@ -2388,29 +2388,29 @@ class FieldInstanceCrudTestCase extends FieldTestCase {
);
field_create_field($field_restricted);
- // Check that an instance can be added to an object type allowed
+ // Check that an instance can be added to an entity type allowed
// by the field.
try {
$instance = $this->instance_definition;
$instance['field_name'] = $field_restricted['field_name'];
$instance['object_type'] = 'test_cacheable_entity';
field_create_instance($instance);
- $this->pass(t('Can create an instance on a object type allowed by the field.'));
+ $this->pass(t('Can create an instance on an entity type allowed by the field.'));
}
catch (FieldException $e) {
- $this->fail(t('Can create an instance on a object type allowed by the field.'));
+ $this->fail(t('Can create an instance on an entity type allowed by the field.'));
}
- // Check that an instance cannot be added to an object type
+ // Check that an instance cannot be added to an entity type
// forbidden by the field.
try {
$instance = $this->instance_definition;
$instance['field_name'] = $field_restricted['field_name'];
field_create_instance($instance);
- $this->fail(t('Cannot create an instance on a object type forbidden by the field.'));
+ $this->fail(t('Cannot create an instance on an entity type forbidden by the field.'));
}
catch (FieldException $e) {
- $this->pass(t('Cannot create an instance on a object type forbidden by the field.'));
+ $this->pass(t('Cannot create an instance on an entity type forbidden by the field.'));
}
// TODO: test other failures.
@@ -2713,9 +2713,9 @@ class FieldTranslationsTestCase extends FieldTestCase {
$hash = md5(serialize(array($entity_type, $entities[$id], $this->field_name, $langcode, $values[$id][$langcode])));
// Check whether the parameters passed to _field_invoke() were correctly
// forwarded to the callback function.
- $this->assertEqual($hash, $result, t('The result for object %id/%language is correctly stored.', array('%id' => $id, '%language' => $langcode)));
+ $this->assertEqual($hash, $result, t('The result for entity %id/%language is correctly stored.', array('%id' => $id, '%language' => $langcode)));
}
- $this->assertEqual(count($results), count($available_languages), t('No unavailable language has been processed for object %id.', array('%id' => $id)));
+ $this->assertEqual(count($results), count($available_languages), t('No unavailable language has been processed for entity %id.', array('%id' => $id)));
}
}
@@ -2725,8 +2725,8 @@ class FieldTranslationsTestCase extends FieldTestCase {
function testTranslatableFieldSaveLoad() {
// Enable field translations for nodes.
field_test_entity_info_translatable('node', TRUE);
- $obj_info = entity_get_info('node');
- $this->assertTrue(count($obj_info['translation']), t('Nodes are translatable.'));
+ $entity_info = entity_get_info('node');
+ $this->assertTrue(count($entity_info['translation']), t('Nodes are translatable.'));
// Prepare the field translations.
field_test_entity_info_translatable('test_entity', TRUE);
@@ -2774,27 +2774,27 @@ class FieldBulkDeleteTestCase extends FieldTestCase {
/**
* Convenience function for Field API tests.
*
- * Given an array of potentially fully-populated objects and an
- * optional field name, generate an array of stub objects of the
+ * Given an array of potentially fully-populated entities and an
+ * optional field name, generate an array of stub entities of the
* same fieldable type which contains the data for the field name
* (if given).
*
* @param $entity_type
* The entity type of $entities.
* @param $entities
- * An array of objects of type $entity_type.
+ * An array of entities of type $entity_type.
* @param $field_name
* Optional; a field name whose data should be copied from
- * $entities into the returned stub objects.
+ * $entities into the returned stub entities.
* @return
- * An array of stub objects corresponding to $entities.
+ * An array of stub entities corresponding to $entities.
*/
- function _generateStubObjects($entity_type, $entities, $field_name = NULL) {
+ function _generateStubEntities($entity_type, $entities, $field_name = NULL) {
$stubs = array();
- foreach ($entities as $obj) {
- $stub = entity_create_stub_entity($entity_type, entity_extract_ids($entity_type, $obj));
+ foreach ($entities as $entity) {
+ $stub = entity_create_stub_entity($entity_type, entity_extract_ids($entity_type, $entity));
if (isset($field_name)) {
- $stub->{$field_name} = $obj->{$field_name};
+ $stub->{$field_name} = $entity->{$field_name};
}
$stubs[] = $stub;
}
@@ -2821,7 +2821,7 @@ class FieldBulkDeleteTestCase extends FieldTestCase {
$this->fields[] = field_create_field($field);
// For each bundle, create an instance of each field, and 10
- // objects with values for each field.
+ // entities with values for each field.
$id = 0;
$this->entity_type = 'test_entity';
foreach ($this->bundles as $bundle) {
@@ -2862,9 +2862,9 @@ class FieldBulkDeleteTestCase extends FieldTestCase {
$bundle = reset($this->bundles);
$field = reset($this->fields);
- // There are 10 objects of this bundle.
+ // There are 10 entities of this bundle.
$found = field_attach_query($field['id'], array(array('bundle', $bundle)), array('limit' => FIELD_QUERY_NO_LIMIT));
- $this->assertEqual(count($found['test_entity']), 10, 'Correct number of objects found before deleting');
+ $this->assertEqual(count($found['test_entity']), 10, 'Correct number of entities found before deleting');
// Delete the instance.
$instance = field_info_instance($this->entity_type, $field['field_name'], $bundle);
@@ -2875,17 +2875,17 @@ class FieldBulkDeleteTestCase extends FieldTestCase {
$this->assertEqual(count($instances), 1, 'There is one deleted instance');
$this->assertEqual($instances[0]['bundle'], $bundle, 'The deleted instance is for the correct bundle');
- // There are 0 objects of this bundle with non-deleted data.
+ // There are 0 entities of this bundle with non-deleted data.
$found = field_attach_query($field['id'], array(array('bundle', $bundle)), array('limit' => FIELD_QUERY_NO_LIMIT));
- $this->assertTrue(!isset($found['test_entity']), 'No objects found after deleting');
+ $this->assertTrue(!isset($found['test_entity']), 'No entities found after deleting');
- // There are 10 objects of this bundle when deleted fields are allowed, and
+ // There are 10 entities of this bundle when deleted fields are allowed, and
// their values are correct.
$found = field_attach_query($field['id'], array(array('bundle', $bundle), array('deleted', 1)), array('limit' => FIELD_QUERY_NO_LIMIT));
field_attach_load($this->entity_type, $found[$this->entity_type], FIELD_LOAD_CURRENT, array('field_id' => $field['id'], 'deleted' => 1));
- $this->assertEqual(count($found['test_entity']), 10, 'Correct number of objects found after deleting');
- foreach ($found['test_entity'] as $id => $obj) {
- $this->assertEqual($this->entities[$id]->{$field['field_name']}, $obj->{$field['field_name']}, "Object $id with deleted data loaded correctly");
+ $this->assertEqual(count($found['test_entity']), 10, 'Correct number of entities found after deleting');
+ foreach ($found['test_entity'] as $id => $entity) {
+ $this->assertEqual($this->entities[$id]->{$field['field_name']}, $entity->{$field['field_name']}, "Entity $id with deleted data loaded correctly");
}
}
@@ -2909,27 +2909,27 @@ class FieldBulkDeleteTestCase extends FieldTestCase {
$batch_size = 2;
for ($count = 8; $count >= 0; $count -= 2) {
- // Purge two objects.
+ // Purge two entities.
field_purge_batch($batch_size);
- // There are $count deleted objects left.
+ // There are $count deleted entities left.
$found = field_attach_query($field['id'], array(array('bundle', $bundle), array('deleted', 1)), array('limit' => FIELD_QUERY_NO_LIMIT));
- $this->assertEqual($count ? count($found['test_entity']) : count($found), $count, 'Correct number of objects found after purging 2');
+ $this->assertEqual($count ? count($found['test_entity']) : count($found), $count, 'Correct number of entities found after purging 2');
}
- // hook_field_delete() was called on a pseudo-object for each object. Each
- // pseudo object has a $field property that matches the original object,
+ // hook_field_delete() was called on a pseudo-entity for each entity. Each
+ // pseudo entity has a $field property that matches the original entity,
// but no others.
$mem = field_test_memorize();
- $this->assertEqual(count($mem['field_test_field_delete']), 10, 'hook_field_delete was called for the right number of objects');
- $stubs = $this->_generateStubObjects($this->entity_type, $this->entities, $field['field_name']);
+ $this->assertEqual(count($mem['field_test_field_delete']), 10, 'hook_field_delete was called for the right number of entities');
+ $stubs = $this->_generateStubEntities($this->entity_type, $this->entities, $field['field_name']);
$count = count($stubs);
foreach ($mem['field_test_field_delete'] as $args) {
- $obj = $args[1];
- $this->assertEqual($stubs[$obj->ftid], $obj, 'hook_field_delete() called with the correct stub');
- unset($stubs[$obj->ftid]);
+ $entity = $args[1];
+ $this->assertEqual($stubs[$entity->ftid], $entity, 'hook_field_delete() called with the correct stub');
+ unset($stubs[$entity->ftid]);
}
- $this->assertEqual(count($stubs), $count-10, 'hook_field_delete was called with each object once');
+ $this->assertEqual(count($stubs), $count-10, 'hook_field_delete was called with each entity once');
// The instance still exists, deleted.
$instances = field_read_instances(array('field_id' => $field['id'], 'deleted' => 1), array('include_deleted' => 1, 'include_inactive' => 1));
diff --git a/modules/field/tests/field_test.entity.inc b/modules/field/tests/field_test.entity.inc
index 71810eb86..3196ebd19 100644
--- a/modules/field/tests/field_test.entity.inc
+++ b/modules/field/tests/field_test.entity.inc
@@ -64,7 +64,7 @@ function field_test_entity_info_alter(&$entity_info) {
}
/**
- * Creates a new bundle for test_entity objects.
+ * Creates a new bundle for test_entity entities.
*
* @param $bundle
* The machine-readable name of the bundle.
@@ -84,7 +84,7 @@ function field_test_create_bundle($bundle, $text = NULL) {
}
/**
- * Renames a bundle for test_entity objects.
+ * Renames a bundle for test_entity entities.
*
* @param $bundle_old
* The machine-readable name of the bundle to rename.
@@ -121,7 +121,7 @@ function field_test_delete_bundle($bundle) {
}
/**
- * Creates a basic test_entity object.
+ * Creates a basic test_entity entity.
*/
function field_test_create_stub_entity($id = 1, $vid = 1, $bundle = 'test_bundle') {
$entity = new stdClass();
diff --git a/modules/field/tests/field_test.storage.inc b/modules/field/tests/field_test.storage.inc
index 1008009d0..617e3b6ae 100644
--- a/modules/field/tests/field_test.storage.inc
+++ b/modules/field/tests/field_test.storage.inc
@@ -254,19 +254,19 @@ function field_test_field_storage_query($field_id, $conditions, $count, &$cursor
$field_data = $data[$field['id']];
$sub_table = $load_current ? 'current' : 'revisions';
- // We need to sort records by object type and object id.
+ // We need to sort records by entity type and entity id.
usort($field_data[$sub_table], '_field_test_field_storage_query_sort_helper');
// Initialize results array.
$return = array();
- $obj_count = 0;
+ $entity_count = 0;
$rows_count = 0;
$rows_total = count($field_data[$sub_table]);
$skip = $cursor;
$skipped = 0;
foreach ($field_data[$sub_table] as $row) {
- if ($count != FIELD_QUERY_NO_LIMIT && $obj_count >= $count) {
+ if ($count != FIELD_QUERY_NO_LIMIT && $entity_count >= $count) {
break;
}
@@ -327,7 +327,7 @@ function field_test_field_storage_query($field_id, $conditions, $count, &$cursor
if (!isset($return[$row->type][$id])) {
$return[$row->type][$id] = entity_create_stub_entity($row->type, array($row->entity_id, $row->revision_id, $row->bundle));
- $obj_count++;
+ $entity_count++;
}
}
else {
@@ -349,7 +349,7 @@ function field_test_field_storage_query($field_id, $conditions, $count, &$cursor
/**
* Sort helper for field_test_field_storage_query().
*
- * Sorts by object type and object id.
+ * Sorts by entity type and entity id.
*/
function _field_test_field_storage_query_sort_helper($a, $b) {
if ($a->type == $b->type) {
diff --git a/modules/field/theme/field.tpl.php b/modules/field/theme/field.tpl.php
index 4ac2cfb98..8478d15a6 100644
--- a/modules/field/theme/field.tpl.php
+++ b/modules/field/theme/field.tpl.php
@@ -26,7 +26,7 @@
* the label position is "above" it would result in "field-label-above".
*
* Other variables:
- * - $element['#object']: The object to which the field is attached.
+ * - $element['#object']: The entity to which the field is attached.
* - $element['#view_mode']: View mode, e.g. 'full', 'teaser'...
* - $element['#field_name']: The field name.
* - $element['#field_type']: The field type.
@@ -43,7 +43,7 @@
* @see theme_field()
*/
?>
-<!--
+<!--
THIS FILE IS NOT USED AND IS HERE AS A STARTING POINT FOR CUSTOMIZATION ONLY.
See http://api.drupal.org/api/function/theme_field/7 for details.
After copying this file to your theme's folder and customizing it, remove this
diff --git a/modules/field_ui/field_ui.admin.inc b/modules/field_ui/field_ui.admin.inc
index 9d4cb4647..e50d8d4c6 100644
--- a/modules/field_ui/field_ui.admin.inc
+++ b/modules/field_ui/field_ui.admin.inc
@@ -790,7 +790,7 @@ function field_ui_existing_field_options($entity_type, $bundle) {
// Don't show
// - locked fields,
// - fields already in the current bundle,
- // - field that cannot be added to the object type.
+ // - field that cannot be added to the entity type.
if (empty($field['locked'])
&& !field_info_instance($entity_type, $field['field_name'], $bundle)
&& (empty($field['object_types']) || in_array($entity_type, $field['object_types']))) {
diff --git a/modules/field_ui/field_ui.module b/modules/field_ui/field_ui.module
index d9ee659a4..2f97a2512 100644
--- a/modules/field_ui/field_ui.module
+++ b/modules/field_ui/field_ui.module
@@ -35,7 +35,7 @@ function field_ui_help($path, $arg) {
function field_ui_menu() {
$items['admin/reports/fields'] = array(
'title' => 'Field list',
- 'description' => 'Overview of fields on all object types.',
+ 'description' => 'Overview of fields on all entity types.',
'page callback' => 'field_ui_fields_list',
'access arguments' => array('administer content types'),
'type' => MENU_NORMAL_ITEM,
diff --git a/modules/field_ui/field_ui.test b/modules/field_ui/field_ui.test
index 624ddd3e5..01064652f 100644
--- a/modules/field_ui/field_ui.test
+++ b/modules/field_ui/field_ui.test
@@ -146,10 +146,10 @@ class FieldUITestCase extends DrupalWebTestCase {
$this->drupalGet(('admin/structure/types/manage/page/fields'));
$this->assertRaw(t('Add existing field'), t('"Add existing field" was found.'));
- // Check that the list of options respects object type restrictions on
- // fields. The 'comment' field is restricted to the 'comment' object type
+ // Check that the list of options respects entity type restrictions on
+ // fields. The 'comment' field is restricted to the 'comment' entity type
// and should not appear in the list.
- $this->assertFalse($this->xpath('//select[@id="edit--add-existing-field-field-name"]//option[@value="comment"]'), t('The list of options respects object type restrictions.'));
+ $this->assertFalse($this->xpath('//select[@id="edit--add-existing-field-field-name"]//option[@value="comment"]'), t('The list of options respects entity type restrictions.'));
// Add a new field based on an existing field.
$edit = array(
@@ -206,7 +206,7 @@ class FieldUITestCase extends DrupalWebTestCase {
* @param $string
* The settings text.
* @param $entity_type
- * The object type for the instance.
+ * The entity type for the instance.
*/
function assertFieldSettings($bundle, $field_name, $string = 'dummy test string', $entity_type = 'node') {
// Reset the fields info.
diff --git a/modules/file/file.field.inc b/modules/file/file.field.inc
index fe55c8cca..eb43c4f35 100644
--- a/modules/file/file.field.inc
+++ b/modules/file/file.field.inc
@@ -205,21 +205,21 @@ function _file_generic_settings_file_directory_validate($element, &$form_state)
* Implements hook_field_load().
*/
function file_field_load($entity_type, $entities, $field, $instances, $langcode, &$items, $age) {
- foreach ($entities as $obj_id => $entity) {
+ foreach ($entities as $id => $entity) {
// Load the files from the files table.
$fids = array();
- foreach ($items[$obj_id] as $delta => $item) {
+ foreach ($items[$id] as $delta => $item) {
$fids[] = $item['fid'];
}
$files = file_load_multiple($fids);
- foreach ($items[$obj_id] as $delta => $item) {
+ foreach ($items[$id] as $delta => $item) {
// If the file does not exist, mark the entire item as empty.
if (empty($item['fid']) || !isset($files[$item['fid']])) {
- $items[$obj_id][$delta] = NULL;
+ $items[$id][$delta] = NULL;
}
else {
- $items[$obj_id][$delta] = array_merge($item, (array) $files[$item['fid']]);
+ $items[$id][$delta] = array_merge($item, (array) $files[$item['fid']]);
}
}
}