function _cer_entity_get_bundle in Corresponding Entity References 7
4 calls to _cer_entity_get_bundle()
- cer_delete in ./cer.crud.inc
- $keys = array(
'home_entity_type' => $key[0],
'home_bundle' => $key[1],
'home_field' => $key[2],
'away_entity_type' => $key[3],
'away_bundle' => $key[4],
'away_field' =>…
- cer_insert in ./cer.crud.inc
- Add any corresponding references on node insertion.
- cer_processing_entity in ./cer.module
- Process a entity's corresponding entity references.
- cer_update in ./cer.crud.inc
- $keys = array(
'home_entity_type' => $key[0],
'home_bundle' => $key[1],
'home_field' => $key[2],
'away_entity_type' => $key[3],
'away_bundle' => $key[4],
'away_field' =>…
File
- ./cer.module, line 337
- Module file providing the "corresponding entity reference" module main
functions.
Code
function _cer_entity_get_bundle($entity, $entity_type) {
$info = entity_get_info($entity_type);
if (empty($info['entity keys']['bundle'])) {
return $entity_type;
}
else {
return $entity->{$info['entity keys']['bundle']};
}
}