You are here

public function Profile::addMatcher in Linkit 8.4

Same name and namespace in other branches
  1. 8.5 src/Entity/Profile.php \Drupal\linkit\Entity\Profile::addMatcher()

Adds a matcher to this profile.

Parameters

array $configuration: An array of matcher configuration.

Return value

string The instance ID of the matcher.

Overrides ProfileInterface::addMatcher

File

src/Entity/Profile.php, line 198
Contains \Drupal\linkit\Entity\Profile.

Class

Profile
Defines the linkit profile entity.

Namespace

Drupal\linkit\Entity

Code

public function addMatcher(array $configuration) {
  $configuration['uuid'] = $this
    ->uuidGenerator()
    ->generate();
  $this
    ->getMatchers()
    ->addInstanceId($configuration['uuid'], $configuration);
  return $configuration['uuid'];
}