Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add options: force_use_attribute_reader, separate_xml_mapping #458

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ public function getConfigTreeBuilder(): TreeBuilder
->cannotBeEmpty()
->defaultValue('en')
->end()
->booleanNode('force_use_attribute_reader')->defaultFalse()->end()
->booleanNode('separate_xml_mapping')->defaultFalse()->end()
->booleanNode('translation_fallback')->defaultFalse()->end()
->booleanNode('persist_default_translation')->defaultFalse()->end()
->booleanNode('skip_translation_on_load')->defaultFalse()->end()
Expand Down
3 changes: 3 additions & 0 deletions src/DependencyInjection/StofDoctrineExtensionsExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,9 @@ public function load(array $configs, ContainerBuilder $container)
$this->entityManagers = $this->processObjectManagerConfigurations($config['orm'], $container, $loader, $loaded, 'doctrine.event_listener');
$this->documentManagers = $this->processObjectManagerConfigurations($config['mongodb'], $container, $loader, $loaded, 'doctrine_mongodb.odm.event_listener');


$container->setParameter('stof_doctrine_extensions.force_use_attribute_reader', $config['force_use_attribute_reader']);
$container->setParameter('stof_doctrine_extensions.separate_xml_mapping', $config['separate_xml_mapping']);
$container->setParameter('stof_doctrine_extensions.default_locale', $config['default_locale']);
$container->setParameter('stof_doctrine_extensions.translation_fallback', $config['translation_fallback']);
$container->setParameter('stof_doctrine_extensions.persist_default_translation', $config['persist_default_translation']);
Expand Down
6 changes: 6 additions & 0 deletions src/Resources/config/blameable.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@
<call method="setAnnotationReader">
<argument type="service" id="annotation_reader" />
</call>
<call method="setForceUseAttributeReader">
<argument>%stof_doctrine_extensions.force_use_attribute_reader%</argument>
</call>
<call method="setSeparateXmlMapping">
<argument>%stof_doctrine_extensions.separate_xml_mapping%</argument>
</call>
</service>

<service id="stof_doctrine_extensions.event_listener.blame" class="%stof_doctrine_extensions.event_listener.blame.class%">
Expand Down
6 changes: 6 additions & 0 deletions src/Resources/config/ip_traceable.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@
<call method="setAnnotationReader">
<argument type="service" id="annotation_reader" />
</call>
<call method="setForceUseAttributeReader">
<argument>%stof_doctrine_extensions.force_use_attribute_reader%</argument>
</call>
<call method="setSeparateXmlMapping">
<argument>%stof_doctrine_extensions.separate_xml_mapping%</argument>
</call>
</service>

<service id="stof_doctrine_extensions.event_listener.ip_trace" class="Stof\DoctrineExtensionsBundle\EventListener\IpTraceListener" public="false">
Expand Down
6 changes: 6 additions & 0 deletions src/Resources/config/loggable.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@
<call method="setAnnotationReader">
<argument type="service" id="annotation_reader" />
</call>
<call method="setForceUseAttributeReader">
<argument>%stof_doctrine_extensions.force_use_attribute_reader%</argument>
</call>
<call method="setSeparateXmlMapping">
<argument>%stof_doctrine_extensions.separate_xml_mapping%</argument>
</call>
</service>

<service id="stof_doctrine_extensions.event_listener.logger" class="%stof_doctrine_extensions.event_listener.logger.class%">
Expand Down
6 changes: 6 additions & 0 deletions src/Resources/config/reference_integrity.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@
<call method="setAnnotationReader">
<argument type="service" id="annotation_reader" />
</call>
<call method="setForceUseAttributeReader">
<argument>%stof_doctrine_extensions.force_use_attribute_reader%</argument>
</call>
<call method="setSeparateXmlMapping">
<argument>%stof_doctrine_extensions.separate_xml_mapping%</argument>
</call>
</service>
</services>
</container>
6 changes: 6 additions & 0 deletions src/Resources/config/sluggable.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@
<call method="setAnnotationReader">
<argument type="service" id="annotation_reader" />
</call>
<call method="setForceUseAttributeReader">
<argument>%stof_doctrine_extensions.force_use_attribute_reader%</argument>
</call>
<call method="setSeparateXmlMapping">
<argument>%stof_doctrine_extensions.separate_xml_mapping%</argument>
</call>
</service>
</services>
</container>
6 changes: 6 additions & 0 deletions src/Resources/config/softdeleteable.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@
<call method="setAnnotationReader">
<argument type="service" id="annotation_reader" />
</call>
<call method="setForceUseAttributeReader">
<argument>%stof_doctrine_extensions.force_use_attribute_reader%</argument>
</call>
<call method="setSeparateXmlMapping">
<argument>%stof_doctrine_extensions.separate_xml_mapping%</argument>
</call>
</service>
</services>
</container>
6 changes: 6 additions & 0 deletions src/Resources/config/sortable.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@
<call method="setAnnotationReader">
<argument type="service" id="annotation_reader" />
</call>
<call method="setForceUseAttributeReader">
<argument>%stof_doctrine_extensions.force_use_attribute_reader%</argument>
</call>
<call method="setSeparateXmlMapping">
<argument>%stof_doctrine_extensions.separate_xml_mapping%</argument>
</call>
</service>
</services>
</container>
6 changes: 6 additions & 0 deletions src/Resources/config/timestampable.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@
<call method="setAnnotationReader">
<argument type="service" id="annotation_reader" />
</call>
<call method="setForceUseAttributeReader">
<argument>%stof_doctrine_extensions.force_use_attribute_reader%</argument>
</call>
<call method="setSeparateXmlMapping">
<argument>%stof_doctrine_extensions.separate_xml_mapping%</argument>
</call>
</service>
</services>
</container>
6 changes: 6 additions & 0 deletions src/Resources/config/translatable.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@
<call method="setSkipOnLoad">
<argument>%stof_doctrine_extensions.skip_translation_on_load%</argument>
</call>
<call method="setForceUseAttributeReader">
<argument>%stof_doctrine_extensions.force_use_attribute_reader%</argument>
</call>
<call method="setSeparateXmlMapping">
<argument>%stof_doctrine_extensions.separate_xml_mapping%</argument>
</call>
</service>

<service id="stof_doctrine_extensions.event_listener.locale" class="%stof_doctrine_extensions.event_listener.locale.class%">
Expand Down
6 changes: 6 additions & 0 deletions src/Resources/config/tree.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@
<call method="setAnnotationReader">
<argument type="service" id="annotation_reader" />
</call>
<call method="setForceUseAttributeReader">
<argument>%stof_doctrine_extensions.force_use_attribute_reader%</argument>
</call>
<call method="setSeparateXmlMapping">
<argument>%stof_doctrine_extensions.separate_xml_mapping%</argument>
</call>
</service>
</services>
</container>
7 changes: 6 additions & 1 deletion src/Resources/config/uploadable.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,15 @@
<call method="setAnnotationReader">
<argument type="service" id="annotation_reader" />
</call>

<call method="setDefaultFileInfoClass">
<argument>%stof_doctrine_extensions.uploadable.default_file_info.class%</argument>
</call>
<call method="setForceUseAttributeReader">
<argument>%stof_doctrine_extensions.force_use_attribute_reader%</argument>
</call>
<call method="setSeparateXmlMapping">
<argument>%stof_doctrine_extensions.separate_xml_mapping%</argument>
</call>
</service>

<service id="stof_doctrine_extensions.uploadable.mime_type_guesser" class="%stof_doctrine_extensions.uploadable.mime_type_guesser.class%" public="false" />
Expand Down