function RulesComponentRepositoryInterface::get

Gets the component for the given ID.

Parameters

string $id: The ID of the component to get. The supported IDs depend on the given provider. For the default provider 'rules' the entity IDs of component configs may be passed.

string $resolver: The resolver of the component. Supported values are:

  • rules_component: (Default) The component configs identified by their ID.
  • rules_event: The aggregated components of all reaction rules configured for an event, identified by the event name; e.g., 'rules_entity_presave'.

Note, that modules may add further resolvers via tagged services. Check the rules.services.yml for an example.

Return value

\Drupal\rules\Engine\RulesComponent|null The component, or NULL if it is not existing.

Throws

\Drupal\rules\Exception\InvalidArgumentException Thrown if an unsupported provider is given.

1 method overrides RulesComponentRepositoryInterface::get()
RulesComponentRepository::get in src/Engine/RulesComponentRepository.php
Gets the component for the given ID.

File

src/Engine/RulesComponentRepositoryInterface.php, line 48

Class

RulesComponentRepositoryInterface
Interface for the component repository.

Namespace

Drupal\rules\Engine

Code

public function get($id, $resolver = 'rules_component');