function _entity_rules_get_bundle_name in Entity Rules 7
Utitility function to get the bundle name as a string.
This is need because different modules handle bundles differently in menu paths.
Parameters
$entity_type:
$bundle: Object or string.
Return value
string Bundle name
1 call to _entity_rules_get_bundle_name()
- entity_rules_type_op_rules in ./
entity_rules.admin.inc - Page call back to list Rules for a bundle.
File
- ./
entity_rules.module, line 890 - Module file for the Entity Rules.
Code
function _entity_rules_get_bundle_name($entity_type, $bundle) {
if (is_object($bundle)) {
$entity_info = entity_get_info($entity_type);
return $bundle->{$entity_info['bundle keys']['bundle']};
}
else {
return $bundle;
}
}