You are here

public function BusinessRule::getItem in Business Rules 8

Same name and namespace in other branches
  1. 2.x src/Entity/BusinessRule.php \Drupal\business_rules\Entity\BusinessRule::getItem()

Get one Business Rule item.

Parameters

string $item_id: The item id.

Return value

BusinessRulesItemObject The item.

Overrides BusinessRuleInterface::getItem

File

src/Entity/BusinessRule.php, line 273

Class

BusinessRule
Defines the Rule entity.

Namespace

Drupal\business_rules\Entity

Code

public function getItem($item_id) {
  if (isset($this->items[$item_id])) {
    $item = $this->items[$item_id];
    $itemObj = new BusinessRulesItemObject($item['id'], $item['type'], $item['weight']);
    return $itemObj;
  }
  else {
    return NULL;
  }
}