You are here

public function Definition::setFactory in Service Container 7.2

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

Sets a factory.

Parameters

string|array $factory A PHP function or an array containing a class/Reference and a method to call:

Return value

Definition The current instance

1 call to Definition::setFactory()
DefinitionDecorator::setFactory in modules/providers/service_container_symfony/lib/Symfony/Component/DependencyInjection/DefinitionDecorator.php
Sets a factory.
1 method overrides Definition::setFactory()
DefinitionDecorator::setFactory in modules/providers/service_container_symfony/lib/Symfony/Component/DependencyInjection/DefinitionDecorator.php
Sets a factory.

File

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

Class

Definition
Definition represents a service definition.

Namespace

Symfony\Component\DependencyInjection

Code

public function setFactory($factory) {
  if (is_string($factory) && strpos($factory, '::') !== false) {
    $factory = explode('::', $factory, 2);
  }
  $this->factory = $factory;
  return $this;
}