class CourierTemplate in Courier 8
Same name and namespace in other branches
- 2.x src/Ajax/CourierTemplate.php \Drupal\courier\Ajax\CourierTemplate
Defines a CourierTemplate AJAX command.
Command is received by `Drupal.AjaxCommands.prototype.courierTemplate`
Hierarchy
- class \Drupal\courier\Ajax\CourierTemplate implements CommandInterface
Expanded class hierarchy of CourierTemplate
2 files declare their use of CourierTemplate
- ChannelFormController.php in src/
Controller/ ChannelFormController.php - TemplateEditForm.php in src/
Form/ TemplateEditForm.php
File
- src/
Ajax/ CourierTemplate.php, line 12
Namespace
Drupal\courier\AjaxView source
class CourierTemplate implements CommandInterface {
/**
* A template collection entity ID.
*
* @var int
*/
protected $template_collection;
/**
* Channel entity type ID.
*
* @var string
*/
protected $channel;
/**
* Operation to execute on client.
*
* @var string
*/
protected $operation;
/**
* Constructs a \Drupal\courier\Ajax\CourierTemplate object.
*
* @param int $template_collection
* A template collection entity ID.
* @param string $channel
* Channel entity type ID.
* @param string $operation
* Operation to execute on client. Allowed values: 'open', 'close'.
*/
public function __construct($template_collection, $channel, $operation) {
$this->template_collection = $template_collection;
$this->channel = $channel;
$this->operation = $operation;
}
/**
* Implements \Drupal\Core\Ajax\CommandInterface::render().
*/
public function render() {
return [
'command' => 'courierTemplate',
'template_collection' => $this->template_collection,
'channel' => $this->channel,
'operation' => $this->operation,
];
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
CourierTemplate:: |
protected | property | Channel entity type ID. | |
CourierTemplate:: |
protected | property | Operation to execute on client. | |
CourierTemplate:: |
protected | property | A template collection entity ID. | |
CourierTemplate:: |
public | function |
Implements \Drupal\Core\Ajax\CommandInterface::render(). Overrides CommandInterface:: |
|
CourierTemplate:: |
public | function | Constructs a \Drupal\courier\Ajax\CourierTemplate object. |