class RulesDataUIBundleEntity in Rules 7.2
Data UI variant displaying a select list of available bundle entities.
This is used for "bundle entities" implemented via the 'bundle of' feature of entity.module.
Hierarchy
- class \RulesDataUI
- class \RulesDataUIText implements RulesDataDirectInputFormInterface
- class \RulesDataUIEntity
- class \RulesDataUIBundleEntity implements RulesDataInputOptionsListInterface
- class \RulesDataUIEntity
- class \RulesDataUIText implements RulesDataDirectInputFormInterface
Expanded class hierarchy of RulesDataUIBundleEntity
1 string reference to 'RulesDataUIBundleEntity'
- rules_rules_core_data_info in modules/
rules_core.rules.inc - Implements hook_rules_data_info() on behalf of the pseudo rules_core module.
File
- ui/
ui.data.inc, line 625 - Contains data type related forms.
View source
class RulesDataUIBundleEntity extends RulesDataUIEntity implements RulesDataInputOptionsListInterface {
/**
* Overrides RulesDataUI::getDefaultMode().
*/
public static function getDefaultMode() {
return 'input';
}
/**
* Implements RulesDataInputOptionsListInterface::optionsList().
*/
public static function optionsList(RulesPlugin $element, $name) {
list($data_type, $parameter_info) = RulesDataUI::getTypeInfo($element, $name);
$bundles = array();
$entity_info = entity_get_info();
$bundle_of_type = $entity_info[$data_type]['bundle of'];
if (isset($entity_info[$bundle_of_type]['bundles'])) {
foreach ($entity_info[$bundle_of_type]['bundles'] as $bundle_name => $bundle_info) {
$bundles[$bundle_name] = $bundle_info['label'];
}
}
return $bundles;
}
}