services:
  telnowedge_websoftkey_logger:
    class: Symfony\Bridge\Monolog\Logger
    factory: 'Telnowedge\BaseBundle\Logger\Logger::getLoggerFactory'
    arguments:
      $logger: '@logger'
    tags:
      - {name: monolog.logger, channel: telnowedge_websoftkey}

  Telnowedge\WebsoftkeyBundle\Manager\KeyFormatManager:
    arguments:
      $logger: '@telnowedge_websoftkey_logger'
    calls:
      - method: setFreePbxContainer
        arguments:
          - '@freepbx_container'

  Telnowedge\WebsoftkeyBundle\Manager\OutputObjectManager:
    arguments:
      $authorizationChecker: '@security.authorization_checker'
      $eventDispatcher: '@event_dispatcher'
      $keyFormatManager: '@Telnowedge\WebsoftkeyBundle\Manager\KeyFormatManager'
      $logger: '@telnowedge_websoftkey_logger'
    calls:
      - method: setFreePbxContainer
        arguments:
          - '@freepbx_container'

  Telnowedge\WebsoftkeyBundle\Manager\RequestManager:
    arguments:
      $logger: '@telnowedge_websoftkey_logger'
      $keyFormatManager: '@Telnowedge\WebsoftkeyBundle\Manager\KeyFormatManager'
    calls:
      - method: setFreePbxContainer
        arguments:
          - '@freepbx_container'

  Telnowedge\WebsoftkeyBundle\Manager\FormManager:
    arguments:
      $logger: '@telnowedge_websoftkey_logger'
    calls:
      - method: setFreePbxContainer
        arguments:
          - '@freepbx_container'

      - method: setFormFactory
        arguments:
          - '@form.factory'

  Telnowedge\WebsoftkeyBundle\Manager\CloneManager:
    arguments:
      $logger: '@telnowedge_websoftkey_logger'
    calls:
      - method: setFreePbxContainer
        arguments:
          - '@freepbx_container'
      - method: initializeServices

  Telnowedge\WebsoftkeyBundle\Form\KeyType:
    arguments:
      $authorizationChecker: '@security.authorization_checker'
    tags:
      - form.type

  Telnowedge\WebsoftkeyBundle\EventSubscriber\KeySubscriber:
    tags:
      - { name: kernel.event_subscriber }

  Telnowedge\WebsoftkeyBundle\Form\FunctionType:
    arguments:
      $translator: '@translator'
    tags:
      - form.type
