You are here

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

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

Init properties.

Parameters

string $item_type: The item type: action|condition.

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

File

src/Controller/ConditionsItemsController.php, line 279

Class

ConditionsItemsController
Class ConditionsItemsController.

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