public function Definition::addMethodCall

Adds a method to call after service initialization.

@api

Parameters

string $method The method name to call:

array $arguments An array of arguments to pass to the method call:

Return value

Definition The current instance

Throws

InvalidArgumentException on empty $method param

1 call to Definition::addMethodCall()
Definition::setMethodCalls in drupal/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Definition.php
Sets the methods to call after service initialization.

File

drupal/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Definition.php, line 318

Class

Definition
Definition represents a service definition.

Namespace

Symfony\Component\DependencyInjection

Code

public function addMethodCall($method, array $arguments = array()) {
  if (empty($method)) {
    throw new InvalidArgumentException(sprintf('Method name cannot be empty.'));
  }
  $this->calls[] = array(
    $method,
    $arguments,
  );
  return $this;
}