You are here

public static function DiffController::create in Entity Share 8.3

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 ControllerBase::create

File

modules/entity_share_diff/src/Controller/DiffController.php, line 55

Class

DiffController
Returns responses for Diff support routes.

Namespace

Drupal\entity_share_diff\Controller

Code

public static function create(ContainerInterface $container) {
  $instance = parent::create($container);
  $instance->remoteManager = $container
    ->get('entity_share_client.remote_manager');
  $instance->resourceTypeRepository = $container
    ->get('jsonapi.resource_type.repository');
  $instance->diffFormatter = $container
    ->get('diff.formatter');
  $instance->entityParser = $container
    ->get('entity_share_diff.entity_parser');
  $instance->dateFormatter = $container
    ->get('date.formatter');
  return $instance;
}