trait TokenTrait in Courier 8
Same name and namespace in other branches
- 2.x src/TokenTrait.php \Drupal\courier\TokenTrait
Provides an implementation of TokenInterface.
Hierarchy
- trait \Drupal\courier\TokenTrait
See also
\Drupal\courier\TokenInterface
1 file declares its use of TokenTrait
- TemplateCollection.php in src/
Entity/ TemplateCollection.php
File
- src/
TokenTrait.php, line 15 - Contains \Drupal\courier\TokenTrait.
Namespace
Drupal\courierView source
trait TokenTrait {
/**
* Token values keyed by token type.
*
* @var array
*/
protected $tokens = [];
/**
* Token options to pass to replace calls.
*
* @var array
*/
protected $token_options = [];
/**
* Implements \Drupal\courier\TokenInterface::setTokenValue().
*/
function setTokenValue($token, $value) {
$this->tokens[$token] = $value;
return $this;
}
/**
* Implements \Drupal\courier\TokenInterface::getTokenValues().
*/
function getTokenValues() {
return $this->tokens;
}
/**
* Implements \Drupal\courier\TokenInterface::getTokenOptions().
*/
function getTokenOptions() {
return $this->token_options;
}
/**
* Implements \Drupal\courier\TokenInterface::setTokenOption().
*/
function setTokenOption($option, $value) {
$this->token_options[$option] = $value;
return $this;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
TokenTrait:: |
protected | property | Token values keyed by token type. | |
TokenTrait:: |
protected | property | Token options to pass to replace calls. | |
TokenTrait:: |
function | Implements \Drupal\courier\TokenInterface::getTokenOptions(). | ||
TokenTrait:: |
function | Implements \Drupal\courier\TokenInterface::getTokenValues(). | ||
TokenTrait:: |
function | Implements \Drupal\courier\TokenInterface::setTokenOption(). | ||
TokenTrait:: |
function | Implements \Drupal\courier\TokenInterface::setTokenValue(). |