class PackageConverter in Ubercart 8.4
Provides upcasting for a node entity in preview.
Hierarchy
- class \Drupal\uc_fulfillment\ParamConverter\PackageConverter implements ParamConverterInterface
Expanded class hierarchy of PackageConverter
1 string reference to 'PackageConverter'
- uc_fulfillment.services.yml in shipping/
uc_fulfillment/ uc_fulfillment.services.yml - shipping/uc_fulfillment/uc_fulfillment.services.yml
1 service uses PackageConverter
- uc_package in shipping/
uc_fulfillment/ uc_fulfillment.services.yml - Drupal\uc_fulfillment\ParamConverter\PackageConverter
File
- shipping/
uc_fulfillment/ src/ ParamConverter/ PackageConverter.php, line 12
Namespace
Drupal\uc_fulfillment\ParamConverterView source
class PackageConverter implements ParamConverterInterface {
/**
* {@inheritdoc}
*/
public function convert($value, $definition, $name, array $defaults) {
return Package::load($value);
}
/**
* {@inheritdoc}
*/
public function applies($definition, $name, Route $route) {
return !empty($definition['type']) && $definition['type'] == 'uc_package';
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
PackageConverter:: |
public | function |
Determines if the converter applies to a specific route and variable. Overrides ParamConverterInterface:: |
|
PackageConverter:: |
public | function |
Converts path variables to their corresponding objects. Overrides ParamConverterInterface:: |