class MassContactConfirmConverter in Mass Contact 8
Provides upcasting information for mass contact email info to a confirm form.
Hierarchy
- class \Drupal\mass_contact\ParamConverter\MassContactConfirmConverter implements ParamConverterInterface
Expanded class hierarchy of MassContactConfirmConverter
1 string reference to 'MassContactConfirmConverter'
1 service uses MassContactConfirmConverter
File
- src/
ParamConverter/ MassContactConfirmConverter.php, line 12
Namespace
Drupal\mass_contact\ParamConverterView source
class MassContactConfirmConverter implements ParamConverterInterface {
/**
* Stores the tempstore factory.
*
* @var \Drupal\user\PrivateTempStoreFactory
*/
protected $tempStoreFactory;
/**
* Constructs a new MassContactConfirmConverter.
*
* @param \Drupal\user\PrivateTempStoreFactory $temp_store_factory
* The factory for the temp store object.
*/
public function __construct(PrivateTempStoreFactory $temp_store_factory) {
$this->tempStoreFactory = $temp_store_factory;
}
/**
* {@inheritdoc}
*/
public function convert($value, $definition, $name, array $defaults) {
$store = $this->tempStoreFactory
->get('mass_contact_confirm_info');
if ($mass_contact_message_info = $store
->get($value)) {
return $mass_contact_message_info;
}
}
/**
* {@inheritdoc}
*/
public function applies($definition, $name, Route $route) {
if (!empty($definition['type']) && $definition['type'] == 'mass_contact_confirm_info') {
return TRUE;
}
return FALSE;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
MassContactConfirmConverter:: |
protected | property | Stores the tempstore factory. | |
MassContactConfirmConverter:: |
public | function |
Determines if the converter applies to a specific route and variable. Overrides ParamConverterInterface:: |
|
MassContactConfirmConverter:: |
public | function |
Converts path variables to their corresponding objects. Overrides ParamConverterInterface:: |
|
MassContactConfirmConverter:: |
public | function | Constructs a new MassContactConfirmConverter. |