Skip to content

Instantly share code, notes, and snippets.

@manoj-apare
Created June 27, 2017 07:50
Show Gist options
  • Save manoj-apare/3d6b1b096f7132e8aca07702a78010b6 to your computer and use it in GitHub Desktop.
Save manoj-apare/3d6b1b096f7132e8aca07702a78010b6 to your computer and use it in GitHub Desktop.
<?php
namespace Drupal\commerce_shipping\Packer;
use Drupal\Core\Entity\EntityTypeManagerInterface;
use Drupal\commerce_order\Entity\OrderInterface;
use Drupal\profile\Entity\ProfileInterface;
use Drupal\commerce_shipping\Packer\PackerInterface;
/**
* Creates multiple shipment based on location.
*/
class CustomPacker implements PackerInterface {
/**
* The entity type manager.
*
* @var \Drupal\Core\Entity\EntityTypeManagerInterface
*/
protected $entityTypeManager;
/**
* Constructs a new DefaultPacker object.
*
* @param \Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager
* The entity type manager.
*/
public function __construct(EntityTypeManagerInterface $entity_type_manager) {
$this->entityTypeManager = $entity_type_manager;
}
/**
* {@inheritdoc}
*/
public function applies(OrderInterface $order, ProfileInterface $shipping_profile) {
}
/**
* {@inheritdoc}
*/
public function pack(OrderInterface $order, ProfileInterface $shipping_profile) {
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment