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 DoctrineStorage to the documentation #418

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Ruesa18
Copy link

@Ruesa18 Ruesa18 commented Aug 23, 2023

References: #377 and #377 (comment) in particular

This PR adds a README entry on how to configure the DoctrineStorage in a project.

@RafaelKr
Copy link

I would recommend to split the configuration if you are using Symfony 4.0+ to better comply with Symfony standards (https://symfony.com/doc/current/bundles/configuration.html#using-the-bundle-extension):

# config/packages/craue_form_flow.yaml
services:
    Craue\FormFlowBundle\Storage\UserSessionStorageKeyGenerator:
        arguments: [ '@security.token_storage', '@request_stack' ]
    Craue\FormFlowBundle\Storage\DoctrineStorage:
        arguments: [ '@doctrine.dbal.default_connection', '@Craue\FormFlowBundle\Storage\UserSessionStorageKeyGenerator' ]
    myCompany.form.flow.storage.doctrine_storage:
        class: 'Craue\FormFlowBundle\Storage\DataManager'
        arguments: [ '@Craue\FormFlowBundle\Storage\DoctrineStorage' ]
# config/services.yaml
services:
    myCompany.form.flow.createVehicle:
        autoconfigure: false
        calls:
            - [ setDataManager, [ '@myCompany.form.flow.storage.doctrine_storage'] ]
            - [ setFormFactory, [ '@form.factory' ] ]
            - [ setRequestStack, [ '@request_stack' ] ]
            - [ setEventDispatcher, [ '@?event_dispatcher' ] ]

@Ruesa18 Ruesa18 force-pushed the feature/377-documentation-doctrine-storage branch from 2189849 to 3ca9cb4 Compare October 24, 2023 17:19
@Ruesa18
Copy link
Author

Ruesa18 commented Oct 24, 2023

Thanks @RafaelKr
I added your code snippet 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants