[Listener] Support additional indexable callback types

Support service/method tuples as indexable callbacks. Closures are also supported, although they cannot be injected by the service container.

The indexable callback is now injected via a setter and validated when set (instead of during event processing).
This commit is contained in:
Jeremy Mikola 2012-04-10 17:23:09 -04:00
commit 86cdaa7c3c
6 changed files with 215 additions and 70 deletions

View file

@ -91,7 +91,6 @@ class Configuration
->thenInvalid('The driver %s is not supported. Please choose one of '.json_encode($this->supportedDrivers))
->end()
->end()
->scalarNode('is_indexable_callback')->defaultNull()->end()
->scalarNode('identifier')->defaultValue('id')->end()
->arrayNode('provider')
->children()
@ -107,6 +106,7 @@ class Configuration
->scalarNode('update')->defaultTrue()->end()
->scalarNode('delete')->defaultTrue()->end()
->scalarNode('service')->end()
->scalarNode('is_indexable_callback')->defaultNull()->end()
->end()
->end()
->arrayNode('finder')
@ -167,7 +167,6 @@ class Configuration
->thenInvalid('The driver %s is not supported. Please choose one of '.json_encode($this->supportedDrivers))
->end()
->end()
->scalarNode('is_indexable_callback')->defaultNull()->end()
->scalarNode('model')->end()
->scalarNode('repository')->end()
->scalarNode('identifier')->defaultValue('id')->end()
@ -185,6 +184,7 @@ class Configuration
->scalarNode('update')->defaultTrue()->end()
->scalarNode('delete')->defaultTrue()->end()
->scalarNode('service')->end()
->scalarNode('is_indexable_callback')->defaultNull()->end()
->end()
->end()
->arrayNode('finder')