summaryrefslogtreecommitdiff
path: root/includes/common.inc
diff options
context:
space:
mode:
authorAngie Byron <webchick@24967.no-reply.drupal.org>2010-03-27 05:52:50 +0000
committerAngie Byron <webchick@24967.no-reply.drupal.org>2010-03-27 05:52:50 +0000
commit7d4b84b8789ffd3ad22dc987860f46c18f9d0f07 (patch)
treea5e7429b505f079ea6e0938f4f7773719200c915 /includes/common.inc
parentf86fda29a3e004e7e38a5d039aa0869a5bd6d888 (diff)
downloadbrdo-7d4b84b8789ffd3ad22dc987860f46c18f9d0f07.tar.gz
brdo-7d4b84b8789ffd3ad22dc987860f46c18f9d0f07.tar.bz2
#707724 follow-up by yched: Fix more confusing field/entity api arguments.
Diffstat (limited to 'includes/common.inc')
-rw-r--r--includes/common.inc20
1 files changed, 10 insertions, 10 deletions
diff --git a/includes/common.inc b/includes/common.inc
index 5857aac6d..1ec294288 100644
--- a/includes/common.inc
+++ b/includes/common.inc
@@ -6251,11 +6251,11 @@ function entity_get_info($entity_type = NULL) {
'load hook' => $name . '_load',
'bundles' => array(),
'view modes' => array(),
- 'object keys' => array(),
+ 'entity keys' => array(),
'cacheable' => TRUE,
'translation' => array(),
);
- $entity_info[$name]['object keys'] += array(
+ $entity_info[$name]['entity keys'] += array(
'revision' => '',
'bundle' => '',
);
@@ -6306,11 +6306,11 @@ function entity_info_cache_clear() {
function entity_extract_ids($entity_type, $entity) {
$info = entity_get_info($entity_type);
// Objects being created might not have id/vid yet.
- $id = isset($entity->{$info['object keys']['id']}) ? $entity->{$info['object keys']['id']} : NULL;
- $vid = ($info['object keys']['revision'] && isset($entity->{$info['object keys']['revision']})) ? $entity->{$info['object keys']['revision']} : NULL;
+ $id = isset($entity->{$info['entity keys']['id']}) ? $entity->{$info['entity keys']['id']} : NULL;
+ $vid = ($info['entity keys']['revision'] && isset($entity->{$info['entity keys']['revision']})) ? $entity->{$info['entity keys']['revision']} : NULL;
// If no bundle key provided, then we assume a single bundle, named after the
// entity type.
- $bundle = $info['object keys']['bundle'] ? $entity->{$info['object keys']['bundle']} : $entity_type;
+ $bundle = $info['entity keys']['bundle'] ? $entity->{$info['entity keys']['bundle']} : $entity_type;
$cacheable = $info['cacheable'];
return array($id, $vid, $bundle, $cacheable);
}
@@ -6334,12 +6334,12 @@ function entity_extract_ids($entity_type, $entity) {
function entity_create_stub_entity($entity_type, $ids) {
$entity = new stdClass();
$info = entity_get_info($entity_type);
- $entity->{$info['object keys']['id']} = $ids[0];
- if (isset($info['object keys']['revision']) && !is_null($ids[1])) {
- $entity->{$info['object keys']['revision']} = $ids[1];
+ $entity->{$info['entity keys']['id']} = $ids[0];
+ if (isset($info['entity keys']['revision']) && !is_null($ids[1])) {
+ $entity->{$info['entity keys']['revision']} = $ids[1];
}
- if ($info['object keys']['bundle']) {
- $entity->{$info['object keys']['bundle']} = $ids[2];
+ if ($info['entity keys']['bundle']) {
+ $entity->{$info['entity keys']['bundle']} = $ids[2];
}
return $entity;
}