You are here

public function ScheduleTaskController::removeCurrentItems in Business Rules 8

Same name and namespace in other branches
  1. 2.x src/Controller/ScheduleTaskController.php \Drupal\business_rules\Controller\ScheduleTaskController::removeCurrentItems()

Remove the action items.

Parameters

string $action_id: The Action id.

array $items: The items.

1 call to ScheduleTaskController::removeCurrentItems()
ScheduleTaskController::itemsTable in src/Controller/ScheduleTaskController.php
The items table.

File

src/Controller/ScheduleTaskController.php, line 286

Class

ScheduleTaskController
Class ScheduleTaskController.

Namespace

Drupal\business_rules\Controller

Code

public function removeCurrentItems($action_id, &$items) {
  $action = Action::load($action_id);
  $current = $action
    ->getSettings('items');
  $current_keys = array_keys($current);
  foreach ($items as $key => $value) {
    if (in_array($value
      ->id(), $current_keys)) {
      unset($items[$key]);
    }
  }
}