#
# Module services
#
# Copyright (c) 2011-present Qualiteam software Ltd. All rights reserved.
# See https://www.x-cart.com/license-agreement.html for license details.
parameters:
  upsCrypterPassPhrase: '%env(default:ups_app_secret:UPS_CRYPTER_PASSPHRASE)%'
  ups_app_secret: '%env(string:APP_SECRET)%'
services:
  _defaults:
    autowire: true
  XC\UPS\Core\EventListener:
    tags:
      - {name: kernel.event_listener, event: xcart.boot, method: onBoot}

  XC\UPS\Core\Crypter:
    arguments:
      $passPhrase: '%upsCrypterPassPhrase%'

  XC\UPS\EntityCallback\ConfigCallback:
    tags:
      - {name: doctrine.orm.entity_listener, event: preUpdate, entity: XLite\Model\Config}
      - {name: doctrine.orm.entity_listener, event: prePersist, entity: XLite\Model\Config}
      - {name: doctrine.orm.entity_listener, event: postUpdate, entity: XLite\Model\Config}
      - {name: doctrine.orm.entity_listener, event: postPersist, entity: XLite\Model\Config}
      - {name: doctrine.orm.entity_listener, event: postLoad, entity: XLite\Model\Config}
