You are here

public static function BasicDeriver::create in Payment 8.2

Creates a new class instance.

Parameters

\Symfony\Component\DependencyInjection\ContainerInterface $container: The container to pull out services used in the fetcher.

string $base_plugin_id: The base plugin ID for the plugin ID.

Return value

static Returns an instance of this fetcher.

Overrides ContainerDeriverInterface::create

1 call to BasicDeriver::create()
BasicDeriverTest::testCreate in tests/src/Unit/Plugin/Payment/Method/BasicDeriverTest.php
@covers ::create @covers ::__construct

File

src/Plugin/Payment/Method/BasicDeriver.php, line 43

Class

BasicDeriver
Derives payment method plugin definitions based on configuration entities.

Namespace

Drupal\payment\Plugin\Payment\Method

Code

public static function create(ContainerInterface $container, $base_plugin_id) {

  /** @var \Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager */
  $entity_type_manager = $container
    ->get('entity_type.manager');
  return new static($entity_type_manager
    ->getStorage('payment_method_configuration'), $container
    ->get('plugin.manager.payment.method_configuration'));
}