class SmsRouteEnhancer in SMS Framework 8
Same name and namespace in other branches
- 2.x src/Routing/Enhancer/SmsRouteEnhancer.php \Drupal\sms\Routing\Enhancer\SmsRouteEnhancer
- 2.1.x src/Routing/Enhancer/SmsRouteEnhancer.php \Drupal\sms\Routing\Enhancer\SmsRouteEnhancer
Route enhancer for SMS Framework.
Hierarchy
- class \Drupal\sms\Routing\Enhancer\SmsRouteEnhancer implements EnhancerInterface
Expanded class hierarchy of SmsRouteEnhancer
1 string reference to 'SmsRouteEnhancer'
1 service uses SmsRouteEnhancer
File
- src/
Routing/ Enhancer/ SmsRouteEnhancer.php, line 13
Namespace
Drupal\sms\Routing\EnhancerView source
class SmsRouteEnhancer implements EnhancerInterface {
/**
* {@inheritdoc}
*/
public function enhance(array $defaults, Request $request) {
$route = $defaults[RouteObjectInterface::ROUTE_OBJECT];
if (!$route
->hasDefault('_sms_gateway_push_endpoint')) {
return $defaults;
}
$gateway_id = $defaults['_sms_gateway_push_endpoint'];
$defaults['sms_gateway'] = SmsGateway::load($gateway_id);
return $defaults;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
SmsRouteEnhancer:: |
public | function | Update the defaults based on its own data and the request. |