You are here

public function ScheduleTaskController::init in Business Rules 2.x

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

Init properties.

Parameters

string $item_type: The item type action|condition.

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

File

src/Controller/ScheduleTaskController.php, line 303

Class

ScheduleTaskController
Class ScheduleTaskController.

Namespace

Drupal\business_rules\Controller

Code

public function init($item_type) {
  $this->item = $item_type;
  switch ($this->item) {
    case 'condition':
      $this->label = $this
        ->t('Condition');
      $this->labelPlural = $this
        ->t('Conditions');
      $this->items = Condition::loadMultiple();
      $this->itemsName = 'conditions';
      $this->itemType = 'condition';
      break;
    case 'action':
      $this->label = $this
        ->t('Action');
      $this->labelPlural = $this
        ->t('Actions');
      $this->items = Action::loadMultiple();
      $this->itemsName = 'actions';
      $this->itemType = 'action';
      break;
  }
}