You are here

public static function Base::create in DRD Agent 4.0.x

Same name in this branch
  1. 4.0.x src/Agent/Action/Base.php \Drupal\drd_agent\Agent\Action\Base::create()
  2. 4.0.x src/Agent/Remote/Base.php \Drupal\drd_agent\Agent\Remote\Base::create()
  3. 4.0.x src/Agent/Auth/Base.php \Drupal\drd_agent\Agent\Auth\Base::create()
Same name and namespace in other branches
  1. 8.3 src/Agent/Action/Base.php \Drupal\drd_agent\Agent\Action\Base::create()

Instantiates a new instance of this class.

This is a factory method that returns a new instance of this class. The factory should pass any needed dependencies into the constructor of this class, but not the container itself. Every call to this method must return a new instance of this class; that is, it may not implement a singleton.

Parameters

\Symfony\Component\DependencyInjection\ContainerInterface $container: The service container this instance should use.

Overrides ContainerInjectionInterface::create

File

src/Agent/Action/Base.php, line 132

Class

Base
Base class for Remote DRD Action Code.

Namespace

Drupal\drd_agent\Agent\Action

Code

public static function create(ContainerInterface $container) {
  return new static($container, $container
    ->get('account_switcher'), $container
    ->get('config.factory'), $container
    ->get('database'), $container
    ->get('entity_type.manager'), $container
    ->get('file_system'), $container
    ->get('logger.factory'), $container
    ->get('messenger'), $container
    ->get('module_handler'), $container
    ->get('state'), $container
    ->get('datetime.time'));
}