public function BusinessRule::getTargetBundleLabel in Business Rules 2.x
Same name and namespace in other branches
- 8 src/Entity/BusinessRule.php \Drupal\business_rules\Entity\BusinessRule::getTargetBundleLabel()
The label of the target entity bundle id which this rule is applicable.
Context: The rule target bundle label.
Overrides BusinessRuleInterface::getTargetBundleLabel
File
- src/
Entity/ BusinessRule.php, line 369
Class
- BusinessRule
- Defines the Rule entity.
Namespace
Drupal\business_rules\EntityCode
public function getTargetBundleLabel() {
$bundles = $this->util
->getBundles($this
->getTargetEntityType());
foreach ($bundles as $key => $value) {
if ($key == $this
->getTargetBundle()) {
if ($key === '') {
return t('All');
}
return $value;
}
}
return '';
}