class RulesDataUIBundleEntity
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 extends \RulesDataUI implements \RulesDataDirectInputFormInterface
- class \RulesDataUIEntity extends \RulesDataUIText
- class \RulesDataUIBundleEntity extends \RulesDataUIEntity implements \RulesDataInputOptionsListInterface
- class \RulesDataUIEntity extends \RulesDataUIText
- class \RulesDataUIText extends \RulesDataUI 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
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;
}
}
Members
Title Sort descending | Modifiers | Object type | Summary | Overriden Title | Overrides |
---|---|---|---|---|---|
RulesDataUI::getTypeInfo | public static | function | Returns the data type and parameter information for the given arguments. | ||
RulesDataUI::renderOptionsLabel | public static | function | Renders the value with a label if an options list is available. | ||
RulesDataUI::selectionForm | public static | function | Provides the selection form for a parameter. | ||
RulesDataUIBundleEntity::getDefaultMode | public static | function | Overrides RulesDataUI::getDefaultMode(). | Overrides RulesDataUIEntity::getDefaultMode | |
RulesDataUIBundleEntity::optionsList | public static | function | Implements RulesDataInputOptionsListInterface::optionsList(). | Overrides RulesDataInputOptionsListInterface::optionsList | |
RulesDataUIEntity::inputForm | public static | function | Implements RulesDataDirectInputFormInterface::inputForm(). | Overrides RulesDataUIText::inputForm | |
RulesDataUIText::render | public static | function | Implements RulesDataDirectInputFormInterface::render(). | Overrides RulesDataDirectInputFormInterface::render | 4 |