Created
March 18, 2015 12:27
-
-
Save visay/e7ec43ce23b5f7002518 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I have 2 packages loaded in order of Package A then Package B. Both have setting of doctrine eventListener as below: | |
Package A Setting | |
----------------- | |
TYPO3: | |
Flow: | |
persistence: | |
doctrine: | |
eventListeners: | |
- | |
events: ['postRemove'] | |
listener: 'My\PackageA\Domain\EventListener\MyPackageAEventListener' | |
Package B Setting | |
----------------- | |
TYPO3: | |
Flow: | |
persistence: | |
doctrine: | |
eventListeners: | |
- | |
events: ['postLoad', 'postPersist', 'preFlush', 'onFlush', 'loadClassMetadata'] | |
listener: 'My\PackageB\Domain\EventListener\MyPackageBEventListener' | |
Then I run: ./flow configuration:show --type Settings --path TYPO3.Flow.persistence.doctrine.eventListeners | |
What I get is: | |
- | |
events: | |
- postLoad | |
- postPersist | |
- preFlush | |
- onFlush | |
- loadClassMetadata | |
listener: My\PackageB\Domain\EventListener\MyPackageBEventListener | |
Is that the expected behaviour? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The reason for this is that all package settings get merged. Your examples translate to
and
note the two indexes 0, the second one will override the first one.
We should avoid using arrays in yaml and go for dictionaries instead:
Now you can override the eventListener explicitly (using the 'MyPackageAEventListener' key) or append a new one, using its own key.