class UpdateOptionsCommand in Business Rules 8
Same name and namespace in other branches
- 2.x src/Ajax/UpdateOptionsCommand.php \Drupal\business_rules\Ajax\UpdateOptionsCommand
Ajax command to update form options.
@package Drupal\business_rules\Ajax
Hierarchy
- class \Drupal\business_rules\Ajax\UpdateOptionsCommand implements CommandInterface
Expanded class hierarchy of UpdateOptionsCommand
1 file declares its use of UpdateOptionsCommand
- BusinessRulesViewsSelection.php in src/
Plugin/ EntityReferenceSelection/ BusinessRulesViewsSelection.php
File
- src/
Ajax/ UpdateOptionsCommand.php, line 12
Namespace
Drupal\business_rules\AjaxView source
class UpdateOptionsCommand implements CommandInterface {
protected $elementId;
protected $options;
protected $formatter;
/**
* UpdateOptionsCommand constructor.
*
* @param string $elementId
* The element html id.
* @param array $options
* The element options [key, value].
* @param string $formatter
* The field formatter.
*/
public function __construct($elementId, array $options, $formatter) {
$this->elementId = $elementId;
$this->options = $options;
$this->formatter = $formatter;
}
/**
* {@inheritdoc}
*/
public function render() {
return [
'command' => 'updateOptionsCommand',
'method' => 'html',
'elementId' => $this->elementId,
'options' => $this->options,
'formatter' => $this->formatter,
];
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
UpdateOptionsCommand:: |
protected | property | ||
UpdateOptionsCommand:: |
protected | property | ||
UpdateOptionsCommand:: |
protected | property | ||
UpdateOptionsCommand:: |
public | function |
Return an array to be run through json_encode and sent to the client. Overrides CommandInterface:: |
|
UpdateOptionsCommand:: |
public | function | UpdateOptionsCommand constructor. |