services:
    # default configuration for services in *this* file
    _defaults:
        # automatically injects dependencies in your services
        autowire: true
        # automatically registers your services as commands, event subscribers, etc.
        autoconfigure: true
        # this means you cannot fetch services directly from the container via $container->get()
        # if you need to do this, you can override this setting on individual services
        public: false

    #
    # CONTROLLERS
    #
    AppBundle\EventListener\JqueryAdminListener: ~

    # auto-register all controllers as services
    AppBundle\Controller\:
        resource: '../../Controller'
        public: true
        tags: [ 'controller.service_arguments' ]

    AppBundle\EventListener\EventListener:
        tags:
            - { name: kernel.event_listener, event: pimcore.dataobject.preUpdate, method: onPreUpdate }
            - { name: kernel.event_listener, event: pimcore.dataobject.postUpdate, method: onPostUpdate }

    AppBundle\Maintenance\SyncOdoo:
        tags:
            - { name: pimcore.maintenance.task, type: syncodoo }

    AppBundle\Command\FullSyncCommand:
        tags:
            - { name: console.command, command: odoo:sync }

    #
    # COMMANDS
    #

    # auto-register all commands as services
    AppBundle\Command\:
        resource: '../../Command/*'
        tags: [ 'console.command' ]
        
    # add more services, or override services that need manual wiring
    #    StockrentBundle\ExampleClass:
    #        arguments:
    #            - "@service_id"
    #            - "plain_value"
    #            - "%parameter%"
    app.security.user_provider:
        class: Pimcore\Security\User\ObjectUserProvider
        arguments:
            - 'AppBundle\Model\DataObject\User'
            - 'email'

        # The encoder factory is responsible for verifying the password hash for a given user. As we need some special
        # handling to be able to work with the password field, we use the UserAwareEncoderFactory to buiild a dedicated
        # encoder per user. This service is configured in pimcore.security.encoder_factories to handle our user model.
    app.security.password_encoder_factory:
        class: Pimcore\Security\Encoder\Factory\UserAwareEncoderFactory
        arguments:
            - Pimcore\Security\Encoder\PasswordFieldEncoder
            - ['password']

