diff options
author | Angie Byron <webchick@24967.no-reply.drupal.org> | 2010-02-11 17:44:47 +0000 |
---|---|---|
committer | Angie Byron <webchick@24967.no-reply.drupal.org> | 2010-02-11 17:44:47 +0000 |
commit | 7562a8efb36306e96bf4d13b1f97b4573809ab45 (patch) | |
tree | 998dfd1d27d9c1a691a83a0c0e37d783d4fc4a44 /modules/taxonomy | |
parent | 52195a6b1dd478875a93935df27d7bcacb14f289 (diff) | |
download | brdo-7562a8efb36306e96bf4d13b1f97b4573809ab45.tar.gz brdo-7562a8efb36306e96bf4d13b1f97b4573809ab45.tar.bz2 |
#707724 by chx: Rename confusing arguments in field/entity APIs.
Diffstat (limited to 'modules/taxonomy')
-rw-r--r-- | modules/taxonomy/taxonomy.module | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/modules/taxonomy/taxonomy.module b/modules/taxonomy/taxonomy.module index d976c4982..2a03f2d47 100644 --- a/modules/taxonomy/taxonomy.module +++ b/modules/taxonomy/taxonomy.module @@ -1126,7 +1126,7 @@ function taxonomy_field_schema($field) { * Possible error codes: * - 'taxonomy_term_illegal_value': The value is not part of the list of allowed values. */ -function taxonomy_field_validate($obj_type, $object, $field, $instance, $langcode, $items, &$errors) { +function taxonomy_field_validate($entity_type, $entity, $field, $instance, $langcode, $items, &$errors) { // Build an array of term IDs so they can be loaded with // taxonomy_term_load_multiple(); foreach ($items as $delta => $item) { @@ -1203,7 +1203,7 @@ function taxonomy_field_formatter_info() { /** * Implements hook_field_formatter_view(). */ -function taxonomy_field_formatter_view($object_type, $object, $field, $instance, $langcode, $items, $display) { +function taxonomy_field_formatter_view($entity_type, $entity, $field, $instance, $langcode, $items, $display) { $element = array(); switch ($display['type']) { @@ -1258,11 +1258,11 @@ function taxonomy_allowed_values($field) { * This preloads all taxonomy terms for multiple loaded objects at once and * unsets values for invalid terms that do not exist. */ -function taxonomy_field_formatter_prepare_view($obj_type, $objects, $field, $instances, $langcode, &$items, $displays) { +function taxonomy_field_formatter_prepare_view($entity_type, $entities, $field, $instances, $langcode, &$items, $displays) { $tids = array(); // Collect every possible term attached to any of the fieldable entities. - foreach ($objects as $id => $object) { + foreach ($entities as $id => $entity) { foreach ($items[$id] as $delta => $item) { // Force the array key to prevent duplicates. $tids[$item['tid']] = $item['tid']; @@ -1272,7 +1272,7 @@ function taxonomy_field_formatter_prepare_view($obj_type, $objects, $field, $ins $terms = taxonomy_term_load_multiple($tids); // Iterate through the fieldable entities again to attach the loaded term data. - foreach ($objects as $id => $object) { + foreach ($entities as $id => $entity) { foreach ($items[$id] as $delta => $item) { // Check whether the taxonomy term field instance value could be loaded. if (isset($terms[$item['tid']])) { @@ -1470,17 +1470,17 @@ function taxonomy_rdf_mapping() { /** * Implements hook_field_insert(). */ -function taxonomy_field_insert($obj_type, $object, $field, $instance, $langcode, &$items) { +function taxonomy_field_insert($entity_type, $entity, $field, $instance, $langcode, &$items) { // We maintain a denormalized table of term/node relationships, containing // only data for current, published nodes. - if (variable_get('taxonomy_maintain_index_table', TRUE) && $field['storage']['type'] == 'field_sql_storage' && $obj_type == 'node' && $object->status) { + if (variable_get('taxonomy_maintain_index_table', TRUE) && $field['storage']['type'] == 'field_sql_storage' && $entity_type == 'node' && $entity->status) { $query = db_insert('taxonomy_index')->fields(array('nid', 'tid', 'sticky', 'created', )); foreach ($items as $item) { $query->values(array( - 'nid' => $object->nid, + 'nid' => $entity->nid, 'tid' => $item['tid'], - 'sticky' => $object->sticky, - 'created' => $object->created, + 'sticky' => $entity->sticky, + 'created' => $entity->created, )); } $query->execute(); @@ -1490,26 +1490,26 @@ function taxonomy_field_insert($obj_type, $object, $field, $instance, $langcode, /** * Implements hook_field_update(). */ -function taxonomy_field_update($obj_type, $object, $field, $instance, $langcode, &$items) { - if (variable_get('taxonomy_maintain_index_table', TRUE) && $field['storage']['type'] == 'field_sql_storage' && $obj_type == 'node') { +function taxonomy_field_update($entity_type, $entity, $field, $instance, $langcode, &$items) { + if (variable_get('taxonomy_maintain_index_table', TRUE) && $field['storage']['type'] == 'field_sql_storage' && $entity_type == 'node') { $first_call = &drupal_static(__FUNCTION__, array()); // 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 // sure we only wipe values once. - if (!isset($first_call[$object->nid])) { - $first_call[$object->nid] = FALSE; - db_delete('taxonomy_index')->condition('nid', $object->nid)->execute(); + if (!isset($first_call[$entity->nid])) { + $first_call[$entity->nid] = FALSE; + db_delete('taxonomy_index')->condition('nid', $entity->nid)->execute(); } // Only save data to the table if the node is published. - if ($object->status) { + if ($entity->status) { $query = db_insert('taxonomy_index')->fields(array('nid', 'tid', 'sticky', 'created')); foreach ($items as $item) { $query->values(array( - 'nid' => $object->nid, + 'nid' => $entity->nid, 'tid' => $item['tid'], - 'sticky' => $object->sticky, - 'created' => $object->created, + 'sticky' => $entity->sticky, + 'created' => $entity->created, )); } $query->execute(); |