You are here

public function BusinessRule::getTargetBundleLabel in Business Rules 8

Same name and namespace in other branches
  1. 2.x 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 346

Class

BusinessRule
Defines the Rule entity.

Namespace

Drupal\business_rules\Entity

Code

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 '';
}