services:
  _defaults:
    autoconfigure: true
  Violution\VioPoll\EventListener\LoadDataContainerListener:
    arguments:
      - '@security.helper'
      - '@Violution\VioPoll\Service\ContentPollService'
    tags:
      - { name: contao.hook, hook: loadDataContainer, priority: 100 }
  Violution\VioPoll\Controller\ContentElement\VioPollStart:
    tags:
      - {name: contao.content_element, category: vio_poll }
  Violution\VioPoll\Controller\ContentElement\VioPollPageBreak:
    tags:
      - {name: contao.content_element, category: vio_poll }
  Violution\VioPoll\Controller\ContentElement\VioPollEnd:
    tags:
      - {name: contao.content_element, category: vio_poll }
  Violution\VioPoll\Controller\ContentElement\VioPollProcessData:
    arguments:
      - '@Violution\VioPoll\Service\ContentPollService'
      - '@monolog.logger.contao.error'
      - '@Violution\VioPoll\Service\AnswerService'
    tags:
      - {name: contao.content_element, category: vio_poll }
  Violution\VioPoll\Controller\ContentElement\VioDropDownEvaluationController:
    tags:
      - {name: contao.content_element, category: vio_poll }
  Violution\VioPoll\Controller\ContentElement\VioDependentDropDownEvaluationController:
    tags:
      - {name: contao.content_element, category: vio_poll }
  Violution\VioPoll\Controller\ContentElement\VioInputFieldEvaluationController:
    tags:
      - {name: contao.content_element, category: vio_poll }
  Violution\VioPoll\Controller\ContentElement\VioNumericalEvaluationController:
    tags:
      - {name: contao.content_element, category: vio_poll }
  Violution\VioPoll\Controller\ContentElement\VioSmileyEvaluationController:
    tags:
      - {name: contao.content_element, category: vio_poll }
  Violution\VioPoll\Controller\ContentElement\VioRadioButtonEvaluationController:
    tags:
      - {name: contao.content_element, category: vio_poll }
  Violution\VioPoll\Controller\ContentElement\VioCheckBoxEvaluationController:
    tags:
      - { name: contao.content_element, category: vio_poll }
  Violution\VioPoll\Controller\ContentElement\VioRadioButtonGroupEvaluationController:
    tags:
      - { name: contao.content_element, category: vio_poll }
  Violution\VioPoll\Controller\ContentElement\VioTextAreaEvaluationController:
    tags:
      - {name: contao.content_element, category: vio_poll }
  Violution\VioPoll\EventListener\GeneratePageListener:
    tags:
      - { name: contao.hook, hook: generatePage, priority: 100 }


  Violution\VioPoll\Controller\VioPollEvaluationBackendController:
    calls:
      - [ setContainer, [ '@Psr\Container\ContainerInterface' ]]
    arguments:
      - '@contao.csrf.token_manager'
      - '@Violution\VioPoll\Service\ContentPollService'
  Violution\VioPoll\Controller\VioPollFilterBackendController:
    calls:
      - [ setContainer, [ '@Psr\Container\ContainerInterface' ] ]
    arguments:
      - '@contao.csrf.token_manager'
      - '@Violution\VioPoll\Service\ContentPollService'
  Violution\VioPoll\Controller\VioPollEvaluationLogicController:
    calls:
      - [ setContainer, [ '@Psr\Container\ContainerInterface' ]]
    arguments:
      - '@contao.framework'
      - '@contao.security.backend_user_provider'
      - '@Violution\VioPoll\Service\CSVExportService'
      - '@Violution\VioPoll\Service\ContentPollService'
      - '@Violution\VioPoll\Service\AccessService'
      - '@Violution\VioPoll\Service\AnswerService'
  Violution\VioPoll\Controller\VioPollEvaluationAjaxController:
    arguments:
      - '@Violution\VioPoll\Controller\VioPollEvaluationLogicController'
      - '@Violution\VioPoll\Controller\VioPollImportCsvController'
      - '@contao.csrf.token_manager'
      - '@contao.security.backend_user_provider'
      - '@Violution\VioPoll\Service\AccessService'
    calls:
      - [ setContainer, [ '@Psr\Container\ContainerInterface' ]]
  Violution\VioPoll\Controller\VioPollImportCsvController:
    arguments:
      - '@Violution\VioPoll\Service\TableBackupService'
      - '%kernel.project_dir%'
      - '@contao.csrf.token_manager'
      - '@contao.security.backend_user_provider'
      - '@Violution\VioPoll\Service\ContentPollService'
      - '@Violution\VioPoll\Service\AccessService'
      - '@Violution\VioPoll\Service\AnswerService'
    calls:
      - [ setContainer, [ '@Psr\Container\ContainerInterface' ]]
  Violution\VioPoll\Controller\VioPollSaveFilterAjaxController:
    arguments:
      - '@contao.framework'
      - '@contao.csrf.token_manager'
      - '@contao.security.backend_user_provider'
      - '@Violution\VioPoll\Service\AccessService'
    calls:
      - [ setContainer, [ '@Psr\Container\ContainerInterface' ]]
  Violution\VioPoll\Controller\VioPollSaveReportingAjaxController:
    arguments:
      - '@contao.csrf.token_manager'
      - '@contao.security.backend_user_provider'
      - '@Violution\VioPoll\Service\AccessService'
    calls:
      - [ setContainer, [ '@Psr\Container\ContainerInterface' ] ]
  Violution\VioPoll\Cron\SendReportCron:
    tags:
      - { name: contao.cronjob, interval: daily }
    arguments:
      - '@contao.framework'
      - '@Violution\VioPoll\Controller\VioPollEvaluationLogicController'
      - '@Violution\VioPoll\Service\DatabaseService'
    calls:
      - [ setContainer, [ '@Psr\Container\ContainerInterface' ]]
  Violution\VioPoll\EventListener\BackendMenuListener:
    - tags: ['terminal42_service_annotation']
  Violution\VioPoll\Service\ContentPollService:
    public: true
    arguments:
      - '@database_connection'
      - '@Violution\VioPoll\Service\DatabaseService'
  Violution\VioPoll\Service\DependentFieldService:
    public: true
    arguments:
      - '@database_connection'
  Violution\VioPoll\Service\AccessService:
    public: true
    arguments:
      - '@database_connection'
      - '@Violution\VioPoll\Service\DatabaseService'
  Violution\VioPoll\Service\AnswerService:
    public: true
    arguments:
      - '@Violution\VioPoll\Service\DatabaseService'
      - '@Violution\VioPoll\Service\CSVExportService'
  Violution\VioPoll\Service\MappingService:
    public: true
    arguments:
      - '@Violution\VioPoll\Service\DependentFieldService'
  Violution\VioPoll\Service\DatabaseService:
    public: true
    arguments:
      - '@Violution\VioPoll\Service\DependentFieldService'
  Violution\VioPoll\Service\CSVExportService:
    public: true
    arguments:
      - '@Violution\VioPoll\Service\ContentPollService'
  Violution\VioPoll\Command\BackupTableCommand:
      arguments:
        - '@contao.framework'
        - '@Violution\VioPoll\Service\TableBackupService'
      tags:
        - { name: console.command }
  Violution\VioPoll\Command\SendReportCommand:
    arguments:
      - '@contao.framework'
      - '@Violution\VioPoll\Cron\SendReportCron'
    tags:
      - { name: console.command }
  Violution\VioPoll\Service\TableBackupService:
      arguments:
        - '@database_connection'
        - '%kernel.project_dir%'
  Violution\VioPoll\Command\ConvertIDsCommand:
      arguments:
        - '@contao.framework'
        - '@database_connection'
        - '@Violution\VioPoll\Service\ContentPollService'
        - '@Violution\VioPoll\Service\MappingService'
      tags:
        - { name: console.command }


  Violution\VioPoll\EventListener\DataContainer\VioReportAddressesSaveCallback:
    tags:
      - { name: contao.callback, table: tl_page, target: fields.vio_report_addresses.save,  priority: 100 }
  Violution\VioPoll\EventListener\DataContainer\VioFilterLabelCallbackListener:
    tags:
      - { name: contao.callback, table: tl_vio_poll_evaluation, target: list.label.label,  priority: 100 }


  Violution\VioPoll\EventListener\DataContainer\VioQuestionTextSaveCallback:
    tags:
      - { name: contao.callback, table: tl_content, target: fields.vio_question_text.save,  priority: 100 }
  Violution\VioPoll\EventListener\DataContainer\VioSubQuestionSaveCallback:
    arguments:
      - '@Violution\VioPoll\Service\MappingService'
    tags:
      - { name: contao.callback, table: tl_content, target: fields.vio_sub_questions.save,  priority: 100 }


  Violution\VioPoll\EventListener\DataContainer\VioSubQuestionLoadCallback:
    arguments:
      - '@Violution\VioPoll\Service\DependentFieldService'
    tags:
      - { name: contao.callback, table: tl_content, target: fields.vio_sub_questions.load,  priority: 100 }
  Violution\VioPoll\EventListener\DataContainer\VioConfigOnLoadCallback:
    arguments:
      - '@Violution\VioPoll\Service\DependentFieldService'
    tags:
      - { name: contao.callback, table: tl_content, target: config.onload,  priority: 100 }