services:
    # event listeners
    phlexible_frontend_media.listener.element:
        class: Phlexible\Bundle\FrontendMediaBundle\EventListener\ElementListener
        arguments:
            - "@phlexible_frontend_media.usage_updater"
            - "@phlexible_queue.job_manager"
        tags:
            - {name: kernel.event_subscriber}

    # fields
    phlexible_frontend_media.field.folder:
        class: Phlexible\Bundle\FrontendMediaBundle\Field\FolderField
        public: false
        tags:
            - {name: phlexible_elementtype.field, alias: folder}

    phlexible_frontend_media.field.file:
        class: Phlexible\Bundle\FrontendMediaBundle\Field\FileField
        public: false
        tags:
            - {name: phlexible_elementtype.field, alias: file}

    # twig extensions
    phlexible_media_manager.twig.media_extension:
        class: Phlexible\Bundle\FrontendMediaBundle\Twig\Extension\MediaExtension
        public: false
        arguments:
            - "@router"
            - "@phlexible_media_manager.volume_manager"
            - "@phlexible_media_manager.file_meta_set_resolver"
            - "@phlexible_media_manager.doctrine.file_meta_data_manager"
        tags:
            - {name: twig.extension}

services:
    # event listeners
    phlexible_frontend_media.listener.element:
        class: Phlexible\Bundle\FrontendMediaBundle\EventListener\ElementListener
        arguments:
            - "@phlexible_frontend_media.usage_updater"
            - "@phlexible_element.element_service"
            - "@phlexible_queue.job_manager"
        tags:
            - {name: kernel.event_subscriber}

    # fields
    phlexible_frontend_media.field.folder:
        class: Phlexible\Bundle\FrontendMediaBundle\Field\FolderField
        public: false
        tags:
            - {name: phlexible_elementtype.field, alias: folder}

    phlexible_frontend_media.field.file:
        class: Phlexible\Bundle\FrontendMediaBundle\Field\FileField
        public: false
        tags:
            - {name: phlexible_elementtype.field, alias: file}

    # twig extensions
    phlexible_media_manager.twig.media_extension:
        class: Phlexible\Bundle\FrontendMediaBundle\Twig\Extension\MediaExtension
        public: false
        arguments:
            - "@router"
            - "@phlexible_media_manager.volume_manager"
            - "@phlexible_media_manager.file_meta_set_resolver"
            - "@phlexible_media_manager.doctrine.file_meta_data_manager"
        tags:
            - {name: twig.extension}


Add element service as dependency for ElementListener
Add element service as dependency for ElementListener
