You are here

public function EntityParameterFactory::__construct in JSON-RPC 8

Same name and namespace in other branches
  1. 2.x src/ParameterFactory/EntityParameterFactory.php \Drupal\jsonrpc\ParameterFactory\EntityParameterFactory::__construct()

EntityParameterFactory constructor.

Parameters

\Drupal\jsonrpc\ParameterDefinitionInterface $definition: The parameter definition.

\JsonSchema\Validator $validator: The validator to ensure the user input is valid.

\Drupal\Core\Entity\EntityRepositoryInterface $entity_repository: The entity type repository to load entities by UUID.

Overrides ParameterFactoryBase::__construct

File

src/ParameterFactory/EntityParameterFactory.php, line 38

Class

EntityParameterFactory
A factory to create loaded entities from entity type & UUID user input.

Namespace

Drupal\jsonrpc\ParameterFactory

Code

public function __construct(ParameterDefinitionInterface $definition, Validator $validator, EntityRepositoryInterface $entity_repository) {
  parent::__construct($definition, $validator);
  $this->entityRepository = $entity_repository;
}