You are here

class ShipmentConverter in Ubercart 8.4

Provides upcasting for a node entity in preview.

Hierarchy

Expanded class hierarchy of ShipmentConverter

1 string reference to 'ShipmentConverter'
uc_fulfillment.services.yml in shipping/uc_fulfillment/uc_fulfillment.services.yml
shipping/uc_fulfillment/uc_fulfillment.services.yml
1 service uses ShipmentConverter
uc_shipment in shipping/uc_fulfillment/uc_fulfillment.services.yml
Drupal\uc_fulfillment\ParamConverter\ShipmentConverter

File

shipping/uc_fulfillment/src/ParamConverter/ShipmentConverter.php, line 12

Namespace

Drupal\uc_fulfillment\ParamConverter
View source
class ShipmentConverter implements ParamConverterInterface {

  /**
   * {@inheritdoc}
   */
  public function convert($value, $definition, $name, array $defaults) {
    return Shipment::load($value);
  }

  /**
   * {@inheritdoc}
   */
  public function applies($definition, $name, Route $route) {
    return !empty($definition['type']) && $definition['type'] == 'uc_shipment';
  }

}

Members

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