services:
  _defaults:
    autowire: true
    autoconfigure: true

  xcart.repository.address_field: '@xcart.repository.address_field.write'

  xcart.repository.address_field.read:
    class: XLite\Model\Repo\AddressField
    factory: ['@doctrine.orm.default_entity_manager', getRepository]
    calls:
      - [setQueryBuilderFactory, ['@xcart.query_builder.factory.address_field.read']]
    arguments:
      - XLite\Model\AddressField

  xcart.repository.address_field.write:
    class: XLite\Model\Repo\AddressField
    factory: ['@doctrine.orm.default_entity_manager', getRepository]
    calls:
      - [setQueryBuilderFactory, ['@xcart.query_builder.factory.address_field.write']]
    arguments:
      - XLite\Model\AddressField

  xcart.repository.category: '@xcart.repository.category.write'

  xcart.repository.category.read:
    class: XLite\Model\Repo\Category
    factory: ['@doctrine.orm.default_entity_manager', getRepository]
    calls:
      - [setQueryBuilderFactory, ['@xcart.query_builder.factory.category.read']]
    arguments:
      - XLite\Model\Category

  xcart.repository.category.write:
    class: XLite\Model\Repo\Category
    factory: ['@doctrine.orm.default_entity_manager', getRepository]
    calls:
      - [setQueryBuilderFactory, ['@xcart.query_builder.factory.category.write']]
    arguments:
      - XLite\Model\Category

  xcart.repository.clean_url:
    class: XLite\Model\Repo\CleanURL
    factory: ['@doctrine.orm.default_entity_manager', getRepository]
    arguments:
      - XLite\Model\CleanURL

  xcart.repository.config:
    class: XLite\Model\Repo\Config
    factory: ['@doctrine.orm.default_entity_manager', getRepository]
    arguments:
      - XLite\Model\Config

  xcart.repository.membership:
    class: XLite\Model\Repo\Membership
    factory: ['@doctrine.orm.default_entity_manager', getRepository]
    arguments:
      - XLite\Model\Membership

  xcart.repository.product: '@xcart.repository.product.write'

  xcart.repository.product.read:
    class: XLite\Model\Repo\Product
    factory: ['@doctrine.orm.default_entity_manager', getRepository]
    calls:
      - [setQueryBuilderFactory, ['@xcart.query_builder.factory.product.read']]
    arguments:
      - XLite\Model\Product

  xcart.repository.product.write:
    class: XLite\Model\Repo\Product
    factory: ['@doctrine.orm.default_entity_manager', getRepository]
    calls:
      - [setQueryBuilderFactory, ['@xcart.query_builder.factory.product.read']]
    arguments:
      - XLite\Model\Product

  xcart.repository.product_class:
    class: XLite\Model\Repo\ProductClass
    factory: ['@doctrine.orm.default_entity_manager', getRepository]
    arguments:
      - XLite\Model\ProductClass

  xcart.repository.profile: '@xcart.repository.profile.write'
  xcart.repository.profile.read:
    class: XLite\Model\Repo\Profile
    factory: ['@doctrine.orm.default_entity_manager', getRepository]
    calls:
      - [setQueryBuilderFactory, ['@xcart.query_builder.factory.profile.read']]
    arguments:
      - XLite\Model\Profile

  xcart.repository.profile.write:
    class: XLite\Model\Repo\Profile
    factory: ['@doctrine.orm.default_entity_manager', getRepository]
    calls:
      - [setQueryBuilderFactory, ['@xcart.query_builder.factory.profile.read']]
    arguments:
      - XLite\Model\Profile

  xcart.repository.role:
    class: XLite\Model\Repo\Role
    factory: ['@doctrine.orm.default_entity_manager', getRepository]
    arguments:
      - XLite\Model\Role

  xcart.repository.state: '@xcart.repository.state.write'

  xcart.repository.state.read:
    class: XLite\Model\Repo\State
    factory: ['@doctrine.orm.default_entity_manager', getRepository]
    calls:
      - [setQueryBuilderFactory, ['@xcart.query_builder.factory.state.read']]
    arguments:
      - XLite\Model\State

  xcart.repository.state.write:
    class: XLite\Model\Repo\State
    factory: ['@doctrine.orm.default_entity_manager', getRepository]
    calls:
      - [setQueryBuilderFactory, ['@xcart.query_builder.factory.state.write']]
    arguments:
      - XLite\Model\State

  xcart.repository.zone:
    class: XLite\Model\Repo\Zone
    factory: ['@doctrine.orm.default_entity_manager', getRepository]
    arguments:
      - XLite\Model\Zone

  xcart.repository.tmpvar.read:
    class: XLite\Model\Repo\TmpVar
    factory: ['@doctrine.orm.default_entity_manager', getRepository]
    calls:
      - [setQueryBuilderFactory, ['@xcart.query_builder.factory.tmp_var.read']]
    arguments:
      - XLite\Model\TmpVar

  xcart.repository.tmpvar.write:
    class: XLite\Model\Repo\TmpVar
    factory: ['@doctrine.orm.default_entity_manager', getRepository]
    calls:
      - [setQueryBuilderFactory, ['@xcart.query_builder.factory.tmp_var.write']]
    arguments:
      - XLite\Model\TmpVar

  xcart.repository.payment.transaction.read:
    class: XLite\Model\Repo\Payment\Transaction
    factory: ['@doctrine.orm.default_entity_manager', getRepository]
    calls:
      - [setQueryBuilderFactory, ['@xcart.query_builder.factory.payment.transaction.read']]
    arguments:
      - XLite\Model\Payment\Transaction

  xcart.repository.payment.transaction.write:
    class: XLite\Model\Repo\Payment\Transaction
    factory: ['@doctrine.orm.default_entity_manager', getRepository]
    calls:
      - [setQueryBuilderFactory, ['@xcart.query_builder.factory.payment.transaction.write']]
    arguments:
      - XLite\Model\Payment\Transaction

  xcart.repository.address: '@xcart.repository.address.write'
  xcart.repository.address.read:
    class: XLite\Model\Repo\Address
    factory: ['@doctrine.orm.default_entity_manager', getRepository]
    calls:
      - [setQueryBuilderFactory, ['@xcart.query_builder.factory.address.read']]
    arguments:
      - XLite\Model\Address

  xcart.repository.address.write:
    class: XLite\Model\Repo\Address
    factory: ['@doctrine.orm.default_entity_manager', getRepository]
    calls:
      - [setQueryBuilderFactory, ['@xcart.query_builder.factory.address.write']]
    arguments:
      - XLite\Model\Address

  xcart.repository.addressfield.read:
    class: XLite\Model\Repo\AddressField
    factory: ['@doctrine.orm.default_entity_manager', getRepository]
    calls:
      - [setQueryBuilderFactory, ['@xcart.query_builder.factory.address_field.read']]
    arguments:
      - XLite\Model\AddressField

  xcart.repository.country.read:
    class: XLite\Model\Repo\Country
    factory: ['@doctrine.orm.default_entity_manager', getRepository]
    calls:
      - [setQueryBuilderFactory, ['@xcart.query_builder.factory.country.read']]
    arguments:
      - XLite\Model\Country

  xcart.repository.config.read:
    class: XLite\Model\Repo\Config
    factory: ['@doctrine.orm.default_entity_manager', getRepository]
    calls:
      - [setQueryBuilderFactory, ['@xcart.query_builder.factory.config.read']]
    arguments:
      - XLite\Model\Config

  # cart
  XLite\Model\Repo\Cart: '@xcart.repository.cart.write'
  xcart.repository.cart: '@xcart.repository.cart.write'
  xcart.repository.cart.read:
    class: XLite\Model\Repo\Cart
    factory: ['@doctrine.orm.default_entity_manager', getRepository]
    calls:
      - [setQueryBuilderFactory, ['@xcart.query_builder.factory.cart.read']]
    arguments:
      - XLite\Model\Cart

  xcart.repository.cart.write:
    class: XLite\Model\Repo\Cart
    factory: ['@doctrine.orm.default_entity_manager', getRepository]
    calls:
      - [setQueryBuilderFactory, ['@xcart.query_builder.factory.cart.write']]
    arguments:
      - XLite\Model\Cart

  # shipping method
  xcart.repository.shipping_method.read:
    class: XLite\Model\Repo\Shipping\Method
    factory: ['@doctrine.orm.default_entity_manager', getRepository]
    calls:
      - [setQueryBuilderFactory, ['@xcart.query_builder.factory.shipping_method.read']]
    arguments:
      - XLite\Model\Shipping\Method

  # order item
  xcart.repository.orderitem: '@xcart.repository.orderitem.write'
  xcart.repository.orderitem.read:
    class: XLite\Model\Repo\Cart
    factory: ['@doctrine.orm.default_entity_manager', getRepository]
    calls:
      - [setQueryBuilderFactory, ['@xcart.query_builder.factory.orderitem.read']]
    arguments:
      - XLite\Model\OrderItem

  xcart.repository.orderitem.write:
    class: XLite\Model\Repo\Cart
    factory: ['@doctrine.orm.default_entity_manager', getRepository]
    calls:
      - [setQueryBuilderFactory, ['@xcart.query_builder.factory.orderitem.write']]
    arguments:
      - XLite\Model\OrderItem
