Re: [fw-general] ServiceManager Factories and Callable functions

2013-11-09 Thread Alexander Torrijos
Thanks, sorry. On Sat, Nov 9, 2013 at 5:13 PM, Artur Bodera wrote: > > On Sat, Nov 9, 2013 at 8:53 AM, Alexander Torrijos > wrote: > >> I was wondering if there are examples on how the factory class composes >> dependencies. >> > > > http://framework.zend.com/manual/2.2/en/modules/zend.service

Re: [fw-general] ServiceManager Factories and Callable functions

2013-11-09 Thread Artur Bodera
On Sat, Nov 9, 2013 at 8:53 AM, Alexander Torrijos wrote: > I was wondering if there are examples on how the factory class composes > dependencies. > http://framework.zend.com/manual/2.2/en/modules/zend.service-manager.intro.html -- abod...@gmail.com +48 695 600 936 http://thinkscape.pro

Re: [fw-general] ServiceManager Factories and Callable functions

2013-11-09 Thread Alexander Torrijos
I just looked at the Zend\Db\Adapter\AdapterServiceFactory as an example: namespace Zend\Db\Adapter; use Zend\ServiceManager\FactoryInterface; use Zend\ServiceManager\ServiceLocatorInterface; class AdapterServiceFactory implements FactoryInterface { /** * Create db adapter service

Re: [fw-general] ServiceManager Factories and Callable functions

2013-11-08 Thread Alexander Torrijos
Hi I was wondering if there are examples on how the factory class composes dependencies. Should it expect to be passed a service manager in it's constructor in the same function a closure does? Should a factory create new instances of objects or should it also retrieve them from the service mana

Re: [fw-general] ServiceManager Factories and Callable functions

2013-11-07 Thread Ben Scholzen 'DASPRiD'
Hi Daniel, > Am I correct in thinking that if I have a ServiceManager defined with > anonymous functions like so: (Added to 'factories' configuration key) > > ... > > it will be called upon every request? The closure will only be called when the controller "Foo" is actually requested. But the f

[fw-general] ServiceManager Factories and Callable functions

2013-11-07 Thread Daniel Latter
Hi All, I am trying to get my head around the best way to configure the service manager. Am I correct in thinking that if I have a ServiceManager defined with anonymous functions like so: (Added to 'factories' configuration key) ... 'Album\Controller\Foo' => function($sm) { $dependancy = ne