@@ -33,13 +33,8 @@ object::
33
33
}
34
34
35
35
To make the ``NewsletterManager `` object available as a service, you can
36
- <<<<<<< HEAD
37
36
configure the service container to use the
38
37
``NewsletterFactory::createNewsletterManager() `` factory method:
39
- =======
40
- configure the service container to use the ``NewsletterManagerFactory ``
41
- factory class:
42
- >>>>>>> 2.3
43
38
44
39
.. configuration-block ::
45
40
@@ -82,18 +77,10 @@ factory class:
82
77
the configured class name may be used by compiler passes and therefore
83
78
should be set to a sensible value.
84
79
85
- <<<<<<< HEAD
86
80
Now, the method will be called statically. If the factory class itself should
87
81
be instantiated and the resulting object's method called, configure the factory
88
82
itself as a service. In this case, the method (e.g. get) should be changed to
89
83
be non-static.
90
- =======
91
- When you specify the class to use for the factory (via ``factory_class ``)
92
- the method will be called statically. If the factory itself should be instantiated
93
- and the resulting object's method called, configure the factory itself
94
- as a service. In this case, the method (e.g. ``createNewsletterManager ``)
95
- should be changed to be non-static:
96
- >>>>>>> 2.3
97
84
98
85
.. configuration-block ::
99
86
@@ -130,18 +117,12 @@ should be changed to be non-static:
130
117
// ...
131
118
$container->register('newsletter_manager.factory', 'NewsletterManagerFactory');
132
119
133
- <<<<<<< HEAD
134
120
$newsletterManager = new Definition();
135
121
$newsletterManager->setFactory(array(
136
122
new Reference('newsletter_manager.factory'),
137
123
'createNewsletterManager'
138
124
));
139
125
$container->setDefinition('newsletter_manager', $newsletterManager);
140
- =======
141
- The factory service is specified by its id name and not a reference
142
- to the service itself. So, you do not need to use the ``@ `` syntax for
143
- this in YAML configurations.
144
- >>>>>>> 2.3
145
126
146
127
Passing Arguments to the Factory Method
147
128
---------------------------------------
0 commit comments