class SynonymsBehaviorServiceParamConverter in Synonyms 8
Param converter for synonyms behavior service.
Hierarchy
- class \Drupal\synonyms\ParamConverter\SynonymsBehaviorServiceParamConverter implements ParamConverterInterface
Expanded class hierarchy of SynonymsBehaviorServiceParamConverter
1 string reference to 'SynonymsBehaviorServiceParamConverter'
1 service uses SynonymsBehaviorServiceParamConverter
File
- src/
ParamConverter/ SynonymsBehaviorServiceParamConverter.php, line 12
Namespace
Drupal\synonyms\ParamConverterView source
class SynonymsBehaviorServiceParamConverter implements ParamConverterInterface {
/**
* Synonyms Behavior Service.
*
* @var \Drupal\synonyms\SynonymsService\BehaviorService
*/
protected $behaviorService;
/**
* SynonymsBehaviorServiceParamConverter constructor.
*/
public function __construct(BehaviorService $behavior_service) {
$this->behaviorService = $behavior_service;
}
/**
* {@inheritdoc}
*/
public function convert($value, $definition, $name, array $defaults) {
return $this->behaviorService
->getBehaviorService($value)['service'];
}
/**
* {@inheritdoc}
*/
public function applies($definition, $name, Route $route) {
return !empty($definition['type']) && $definition['type'] == 'synonyms_behavior_service';
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
SynonymsBehaviorServiceParamConverter:: |
protected | property | Synonyms Behavior Service. | |
SynonymsBehaviorServiceParamConverter:: |
public | function |
Determines if the converter applies to a specific route and variable. Overrides ParamConverterInterface:: |
|
SynonymsBehaviorServiceParamConverter:: |
public | function |
Converts path variables to their corresponding objects. Overrides ParamConverterInterface:: |
|
SynonymsBehaviorServiceParamConverter:: |
public | function | SynonymsBehaviorServiceParamConverter constructor. |