You are here

public function BusinessRule::addItem in Business Rules 2.x

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

Add one item on the Business Rule's items.

Parameters

\Drupal\business_rules\BusinessRulesItemObject $item: The item to be added.

Overrides BusinessRuleInterface::addItem

File

src/Entity/BusinessRule.php, line 354

Class

BusinessRule
Defines the Rule entity.

Namespace

Drupal\business_rules\Entity

Code

public function addItem(BusinessRulesItemObject $item) {
  $item_array = $item
    ->toArray();
  $this->items[$item
    ->getId()] = $item_array[$item
    ->getId()];
}