You are here

public function BehaviorService::addBehaviorService in Synonyms 8

Same name and namespace in other branches
  1. 2.0.x src/SynonymsService/BehaviorService.php \Drupal\synonyms\SynonymsService\BehaviorService::addBehaviorService()

Add a new discovered behavior service.

Parameters

\Drupal\synonyms\SynonymsService\Behavior\SynonymsBehaviorInterface $behavior_service: Behavior service object that was discovered and should be added into the list of known ones.

string $id: Service ID that corresponds to this behavior service.

File

src/SynonymsService/BehaviorService.php, line 59

Class

BehaviorService
Collect all known synonyms behavior services.

Namespace

Drupal\synonyms\SynonymsService

Code

public function addBehaviorService(SynonymsBehaviorInterface $behavior_service, $id) {
  if (!isset($this->behaviorServices[$id])) {
    $this->behaviorServices[$id] = [
      'service' => $behavior_service,
    ];
  }
}