You are here

class PackageConverter in Ubercart 8.4

Provides upcasting for a node entity in preview.

Hierarchy

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\ParamConverter
View 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

Namesort descending Modifiers Type Description Overrides
PackageConverter::applies public function Determines if the converter applies to a specific route and variable. Overrides ParamConverterInterface::applies
PackageConverter::convert public function Converts path variables to their corresponding objects. Overrides ParamConverterInterface::convert