Skip to content

Commit 3e77ce6

Browse files
Merge pull request #1 from bobvandevijver/fix-class-autowiring
Add service configuration for class autowiring
2 parents 8198101 + 68a0011 commit 3e77ce6

File tree

2 files changed

+19
-11
lines changed

2 files changed

+19
-11
lines changed

DependencyInjection/BobVEntityHistoryExtension.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,9 @@ public function load(array $configs, ContainerBuilder $container) {
4242

4343
// Create the service tags
4444
foreach ($config['connections'] as $connection) {
45-
$container->getDefinition('bobv.entityhistory.create_schema_subscriber')
45+
$container->findDefinition('bobv.entityhistory.create_schema_subscriber')
4646
->addTag('doctrine.event_subscriber', array('connection' => $connection));
47-
$container->getDefinition('bobv.entityhistory.log_history_subscriber')
47+
$container->findDefinition('bobv.entityhistory.log_history_subscriber')
4848
->addTag('doctrine.event_subscriber', array('connection' => $connection));
4949
}
5050

Resources/config/services.yml

+17-9
Original file line numberDiff line numberDiff line change
@@ -6,26 +6,34 @@ parameters:
66
bobv.entityhistory.entities: {}
77

88
services:
9-
bobv.entityhistory.configuration:
10-
class: BobV\EntityHistoryBundle\Configuration\HistoryConfiguration
9+
BobV\EntityHistoryBundle\Configuration\HistoryConfiguration:
1110
arguments:
1211
- "@service_container"
1312
calls:
1413
- [injectVars, [ "%bobv.entityhistory.table_prefix%", "%bobv.entityhistory.table_suffix%", "%bobv.entityhistory.revision_field_name%", "%bobv.entityhistory.revision_type_field_name%", "%bobv.entityhistory.entities%", "%bobv.entityhistory.deleted_at_field%", "%bobv.entityhistory.deleted_by_field%", "%bobv.entityhistory.deleted_by_method%" ]]
1514

16-
bobv.entityhistory.create_schema_subscriber:
17-
class: BobV\EntityHistoryBundle\EventSubscriber\CreateSchemaSubscriber
15+
bobv.entityhistory.configuration:
16+
alias: BobV\EntityHistoryBundle\Configuration\HistoryConfiguration
17+
18+
BobV\EntityHistoryBundle\EventSubscriber\CreateSchemaSubscriber:
1819
arguments:
1920
- "@bobv.entityhistory.configuration"
2021

21-
bobv.entityhistory.log_history_subscriber:
22-
class: BobV\EntityHistoryBundle\EventSubscriber\LogHistorySubscriber
22+
bobv.entityhistory.create_schema_subscriber:
23+
alias: BobV\EntityHistoryBundle\EventSubscriber\CreateSchemaSubscriber
24+
25+
BobV\EntityHistoryBundle\EventSubscriber\LogHistorySubscriber:
2326
arguments:
2427
- "@bobv.entityhistory.configuration"
2528

26-
bobv.entitybundle.history_reader:
27-
class: BobV\EntityHistoryBundle\Reader\HistoryReader
29+
bobv.entityhistory.log_history_subscriber:
30+
alias: BobV\EntityHistoryBundle\EventSubscriber\LogHistorySubscriber
31+
32+
BobV\EntityHistoryBundle\Reader\HistoryReader:
2833
lazy: true
2934
arguments:
3035
- "@doctrine.orm.entity_manager"
31-
- "@bobv.entityhistory.configuration"
36+
- "@bobv.entityhistory.configuration"
37+
38+
bobv.entitybundle.history_reader:
39+
alias: BobV\EntityHistoryBundle\Reader\HistoryReader

0 commit comments

Comments
 (0)