function SetterInjection::setter

Same name in other branches
  1. 9 core/modules/system/tests/modules/new_dependency_test/src/SetterInjection.php \Drupal\new_dependency_test\SetterInjection::setter()
  2. 8.9.x core/modules/system/tests/modules/new_dependency_test/src/SetterInjection.php \Drupal\new_dependency_test\SetterInjection::setter()
  3. 10 core/modules/system/tests/modules/new_dependency_test/src/SetterInjection.php \Drupal\new_dependency_test\SetterInjection::setter()

SetterInjection constructor.

Parameters

\Drupal\new_dependency_test_with_service\NewService $service: The service of the new module.

File

core/modules/system/tests/modules/new_dependency_test/src/SetterInjection.php, line 27

Class

SetterInjection
Generic service which uses setter injection.

Namespace

Drupal\new_dependency_test

Code

public function setter(NewService $service) {
    $this->service = $service;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.