You are here

public function Definition::setFactoryMethod in Service Container 7

Same name and namespace in other branches
  1. 7.2 modules/providers/service_container_symfony/lib/Symfony/Component/DependencyInjection/Definition.php \Symfony\Component\DependencyInjection\Definition::setFactoryMethod()

Sets the factory method able to create an instance of this class.

@api

Parameters

string $factoryMethod The factory method name:

Return value

Definition The current instance

Deprecated

since version 2.6, to be removed in 3.0.

1 call to Definition::setFactoryMethod()
DefinitionDecorator::setFactoryMethod in modules/providers/service_container_symfony/lib/Symfony/Component/DependencyInjection/DefinitionDecorator.php
@api
1 method overrides Definition::setFactoryMethod()
DefinitionDecorator::setFactoryMethod in modules/providers/service_container_symfony/lib/Symfony/Component/DependencyInjection/DefinitionDecorator.php
@api

File

modules/providers/service_container_symfony/lib/Symfony/Component/DependencyInjection/Definition.php, line 135

Class

Definition
Definition represents a service definition.

Namespace

Symfony\Component\DependencyInjection

Code

public function setFactoryMethod($factoryMethod) {
  trigger_error(sprintf('%s(%s) is deprecated since version 2.6 and will be removed in 3.0. Use Definition::setFactory() instead.', __METHOD__, $factoryMethod), E_USER_DEPRECATED);
  $this->factoryMethod = $factoryMethod;
  return $this;
}