parameters:
    pim_catalog.repository.group.class:                 Akeneo\Pim\Enrichment\Bundle\Doctrine\ORM\Repository\GroupRepository
    pim_catalog.repository.product_unique_data.class:   Akeneo\Pim\Enrichment\Bundle\Doctrine\ORM\Repository\ProductUniqueDataRepository
    pim_catalog.repository.association.class:           Akeneo\Pim\Enrichment\Bundle\Doctrine\ORM\Repository\AssociationRepository
    pim_catalog.repository.product.class:               Akeneo\Pim\Enrichment\Bundle\Doctrine\ORM\Repository\ProductRepository
    pim_catalog.repository.product_model.class:         Akeneo\Pim\Enrichment\Bundle\Doctrine\ORM\Repository\ProductModelRepository
    pim_catalog.repository.product_mass_action.class:   Akeneo\Pim\Enrichment\Bundle\Doctrine\ORM\Repository\ProductMassActionRepository
    pim_catalog.repository.product_category.class:      Akeneo\Pim\Enrichment\Bundle\Doctrine\ORM\Repository\ProductCategoryRepository
    pim_catalog.repository.product_model_category.class: Akeneo\Pim\Enrichment\Bundle\Doctrine\ORM\Repository\ProductModelCategoryRepository
    pim_catalog.repository.entity_with_family_variant.class: Akeneo\Pim\Enrichment\Bundle\Doctrine\ORM\Repository\EntityWithFamilyVariantRepository
    pim_catalog.repository.variant_product.class: Akeneo\Pim\Enrichment\Bundle\Doctrine\ORM\Repository\VariantProductRepository

services:
    # Base repositories
    pim_catalog.repository.group:
        class: '%pim_catalog.repository.group.class%'
        factory: ['@doctrine.orm.entity_manager', 'getRepository']
        arguments: ['%pim_catalog.entity.group.class%']
        tags:
            - { name: 'pim_repository' }

    pim_catalog.repository.product_unique_data:
        class: '%pim_catalog.repository.product_unique_data.class%'
        factory: ['@doctrine.orm.entity_manager', 'getRepository']
        arguments: ['%pim_catalog.entity.product_unique_data.class%']
        tags:
            - { name: 'pim_repository' }

    pim_catalog.repository.product_model:
        class: '%pim_catalog.repository.product_model.class%'
        factory: ['@doctrine.orm.entity_manager', 'getRepository']
        arguments: ['%pim_catalog.entity.product_model.class%']
        tags:
            - { name: 'pim_repository' }

    # Cached object repositories
    pim_catalog.repository.cached_attribute:
        class: '%akeneo_storage_utils.repository.base_cached_object.class%'
        arguments:
            - '@pim_catalog.repository.attribute'

    pim_catalog.repository.cached_attribute_option:
        class: '%akeneo_storage_utils.repository.base_cached_object.class%'
        arguments:
            - '@pim_catalog.repository.attribute_option'

    pim_catalog.repository.cached_family:
        class: '%akeneo_storage_utils.repository.base_cached_object.class%'
        arguments:
            - '@pim_catalog.repository.family'

    pim_catalog.repository.cached_category:
        class: '%akeneo_storage_utils.repository.base_cached_object.class%'
        arguments:
            - '@pim_catalog.repository.category'

    pim_catalog.repository.cached_channel:
        class: '%akeneo_storage_utils.repository.base_cached_object.class%'
        arguments:
            - '@pim_catalog.repository.channel'

    pim_catalog.repository.cached_locale:
        class: '%akeneo_storage_utils.repository.base_cached_object.class%'
        arguments:
            - '@pim_catalog.repository.locale'

    pim_catalog.repository.cached_currency:
        class: '%akeneo_storage_utils.repository.base_cached_object.class%'
        arguments:
            - '@pim_catalog.repository.currency'

    pim_catalog.repository.product:
        class: '%pim_catalog.repository.product.class%'
        factory: ['@doctrine.orm.entity_manager', 'getRepository']
        arguments: ['%pim_catalog.entity.product.class%']
        tags:
            - { name: 'pim_repository' }

    pim_catalog.repository.variant_product:
        class: '%pim_catalog.repository.variant_product.class%'
        arguments:
            - '@pim_catalog.object_manager.product'

    pim_catalog.repository.product_mass_action:
        class: '%pim_catalog.repository.product_mass_action.class%'
        arguments:
            - '@pim_catalog.object_manager.product'
            - '%pim_catalog.entity.product.class%'

    pim_catalog.repository.product_category:
        class:  '%pim_catalog.repository.product_category.class%'
        parent: akeneo_classification.repository.abstract_item_category
        arguments:
            - '@pim_catalog.object_manager.product'
            - '%pim_catalog.entity.product.class%'
            - '%pim_catalog.entity.category.class%'

    pim_catalog.repository.product_model_category:
        class:  '%pim_catalog.repository.product_model_category.class%'
        parent: akeneo_classification.repository.abstract_item_category
        arguments:
            - '@pim_catalog.object_manager.product'
            - '%pim_catalog.entity.product_model.class%'
            - '%pim_catalog.entity.category.class%'

    pim_catalog.repository.association:
        class: '%pim_catalog.repository.association.class%'
        factory: ['@doctrine.orm.entity_manager', 'getRepository']
        arguments: ['%pim_catalog.entity.association.class%']
        tags:
            - { name: 'pim_repository' }

    pim_catalog.repository.entity_with_family_variant:
        class: '%pim_catalog.repository.entity_with_family_variant.class%'
        arguments:
            - '@pim_catalog.repository.product_model'
            - '@pim_catalog.repository.variant_product'

    pim_comment.repository.comment:
        class: 'Akeneo\Pim\Enrichment\Bundle\Doctrine\ORM\Repository\CommentRepository'
        factory: ['@doctrine.orm.entity_manager', 'getRepository']
        arguments: ['%pim_comment.entity.comment.class%']
        tags:
            - { name: 'pim_repository' }

    pim_api.repository.product:
        class: 'Akeneo\Pim\Enrichment\Bundle\Doctrine\ORM\Repository\ExternalApi\ProductRepository'
        arguments:
            - '@pim_catalog.object_manager.product'
            - '%pim_catalog.entity.product.class%'
            - '@pim_catalog.repository.product'

    pim_api.repository.category:
        class: 'Akeneo\Pim\Enrichment\Bundle\Doctrine\ORM\Repository\ExternalApi\CategoryRepository'
        arguments:
            - '@doctrine.orm.entity_manager'
            - '%pim_catalog.entity.category.class%'
            - '@pim_catalog.repository.category'

    pim_enrich.repository.category:
        public: true
        class: 'Akeneo\Pim\Enrichment\Bundle\Doctrine\ORM\Repository\InternalApi\CategoryRepository'
        arguments:
            - '@pim_user.context.user'
            - '@doctrine.orm.entity_manager'
            - '%pim_catalog.entity.category.class%'

    pim_enrich.repository.group:
        class: 'Akeneo\Pim\Enrichment\Bundle\Doctrine\ORM\Repository\InternalApi\GroupRepository'
        arguments:
            - '@pim_user.context.user'
            - '@doctrine.orm.entity_manager'
            - '%pim_catalog.entity.group.class%'
