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

  Telnowedge\DirectoryBundle\Provider\AbstractLdapProvider:
    abstract: true
    calls:
      - method: setFreePbxContainer
        arguments:
          - '@freepbx_container'
      - method: setFreePbxManager
        arguments:
          - '@freepbx_manager'
      - method: initLdapConnection
      - method: initAmpConfManager
      - method: setLogger
        arguments:
          $logger: '@telnowedge_directory_logger'

  Telnowedge\DirectoryBundle\Provider\CommonLdapProvider:
    parent: Telnowedge\DirectoryBundle\Provider\AbstractLdapProvider
    arguments:
      $internalLdapProvider: '@Telnowedge\DirectoryBundle\Provider\InternalLdapProvider'
      $externalLdapProvider: '@Telnowedge\DirectoryBundle\Provider\ExternalLdapProvider'
      $privateLdapProvider: '@Telnowedge\DirectoryBundle\Provider\PrivateLdapProvider'
      $speedDialLdapProvider: '@Telnowedge\DirectoryBundle\Provider\SpeedDialLdapProvider'
      $shareLdapProvider: '@Telnowedge\DirectoryBundle\Provider\ShareLdapProvider'

  Telnowedge\DirectoryBundle\Provider\InternalLdapProvider:
    parent: Telnowedge\DirectoryBundle\Provider\AbstractLdapProvider

  Telnowedge\DirectoryBundle\Provider\ExternalLdapProvider:
    parent: Telnowedge\DirectoryBundle\Provider\AbstractLdapProvider

  Telnowedge\DirectoryBundle\Provider\PrivateLdapProvider:
    parent: Telnowedge\DirectoryBundle\Provider\AbstractLdapProvider

  Telnowedge\DirectoryBundle\Provider\SpeedDialLdapProvider:
    parent: Telnowedge\DirectoryBundle\Provider\AbstractLdapProvider

  Telnowedge\DirectoryBundle\Provider\ShareLdapProvider:
    parent: Telnowedge\DirectoryBundle\Provider\AbstractLdapProvider
    calls:
      - method: setOuManager
        arguments:
          - '@Telnowedge\DirectoryBundle\Manager\OuManager'

  Telnowedge\DirectoryBundle\Provider\DirectoryProvider:
    arguments:
      $freepbxManager: '@freepbx_manager'

  Telnowedge\DirectoryBundle\Manager\DirectoryManager:
    arguments:
      $commonLdapProvider: '@Telnowedge\DirectoryBundle\Provider\CommonLdapProvider'
      $companyManager: '@Telnowedge\DirectoryBundle\Manager\CompanyManager'
      $externalLdapProvider: '@Telnowedge\DirectoryBundle\Provider\ExternalLdapProvider'
      $internalLdapProvider: '@Telnowedge\DirectoryBundle\Provider\InternalLdapProvider'
      $privateLdapProvider: '@Telnowedge\DirectoryBundle\Provider\PrivateLdapProvider'
      $shareLdapProvider: '@Telnowedge\DirectoryBundle\Provider\ShareLdapProvider'
      $speedDialLdapProvider: '@Telnowedge\DirectoryBundle\Provider\SpeedDialLdapProvider'

  Telnowedge\DirectoryBundle\Manager\CompanyManager:
    arguments:
      $logger: '@telnowedge_directory_logger'
    calls:
      - method: setFreePbxContainer
        arguments:
          - '@freepbx_container'

  Telnowedge\DirectoryBundle\Manager\RequestManager:
    arguments:
      $logger: '@telnowedge_directory_logger'

  Telnowedge\DirectoryBundle\Handler\LdapHandler\DirectoryUserLdapHandler:
    parent: Telnowedge\BaseBundle\Handler\AbstractLdapHandler

  Telnowedge\DirectoryBundle\Handler\LdapHandler\PrivateDirectoryUserLdapHandler:
    parent: Telnowedge\BaseBundle\Handler\AbstractLdapHandler

  Telnowedge\DirectoryBundle\Repository\Proxy\ShareSkelRepository:
    parent: Telnowedge\BaseBundle\Repository\AbstractLinkRepository

  Telnowedge\DirectoryBundle\Validator\Constraints\UniqueNameValidator:
    calls:
      - method: setContainer
        arguments:
          - '@service_container'
    tags: [validator.constraint_validator]

  Telnowedge\DirectoryBundle\Validator\Constraints\AuthorizedParentValidator:
    calls:
      - method: setContainer
        arguments:
          - '@service_container'
    tags: [validator.constraint_validator]

  Telnowedge\DirectoryBundle\Manager\OuManager:
    calls:
      - method: setContainer
        arguments:
          - '@service_container'
