You are here

public static function ViewPaymentsByOwner::create in Payment 8.2

Same name in this branch
  1. 8.2 src/Controller/ViewPaymentsByOwner.php \Drupal\payment\Controller\ViewPaymentsByOwner::create()
  2. 8.2 src/Plugin/views/argument_validator/ViewPaymentsByOwner.php \Drupal\payment\Plugin\views\argument_validator\ViewPaymentsByOwner::create()

Creates an instance of the plugin.

Parameters

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

array $configuration: A configuration array containing information about the plugin instance.

string $plugin_id: The plugin ID for the plugin instance.

mixed $plugin_definition: The plugin implementation definition.

Return value

static Returns an instance of this plugin.

Overrides Entity::create

File

src/Plugin/views/argument_validator/ViewPaymentsByOwner.php, line 30

Class

ViewPaymentsByOwner
Validates whether the current user has access to view a user's payments.

Namespace

Drupal\payment\Plugin\views\argument_validator

Code

public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
  $argument_validator = parent::create($container, $configuration, $plugin_id, $plugin_definition);
  $argument_validator->currentUser = $container
    ->get('current_user');
  return $argument_validator;
}