public function LoopThroughViewResultController::init in Business Rules 8
Same name and namespace in other branches
- 2.x src/Controller/LoopThroughViewResultController.php \Drupal\business_rules\Controller\LoopThroughViewResultController::init()
Init properties.
Parameters
string $item_type: The item type: action|condition.
1 call to LoopThroughViewResultController::init()
- LoopThroughViewResultController::itemsTable in src/
Controller/ LoopThroughViewResultController.php - The items table.
File
- src/
Controller/ LoopThroughViewResultController.php, line 275
Class
- LoopThroughViewResultController
- Class LoopThroughViewResultController.
Namespace
Drupal\business_rules\ControllerCode
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;
}
}