OrderPromotionOfferBase.php in Commerce Core 8.2
File
modules/promotion/src/Plugin/Commerce/PromotionOffer/OrderPromotionOfferBase.php
View source
<?php
namespace Drupal\commerce_promotion\Plugin\Commerce\PromotionOffer;
use Drupal\commerce_order\PriceSplitterInterface;
use Drupal\commerce_price\RounderInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
abstract class OrderPromotionOfferBase extends PromotionOfferBase implements OrderPromotionOfferInterface {
protected $splitter;
public function __construct(array $configuration, $plugin_id, $plugin_definition, RounderInterface $rounder, PriceSplitterInterface $splitter) {
parent::__construct($configuration, $plugin_id, $plugin_definition, $rounder);
$this->splitter = $splitter;
}
public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
return new static($configuration, $plugin_id, $plugin_definition, $container
->get('commerce_price.rounder'), $container
->get('commerce_order.price_splitter'));
}
}