services:
    pim_catalog.repository.association_type:
        class: 'Akeneo\Pim\Structure\Bundle\Doctrine\ORM\Repository\AssociationTypeRepository'
        factory: ['@doctrine.orm.entity_manager', 'getRepository']
        arguments: ['%pim_catalog.entity.association_type.class%']
        tags:
            - { name: 'pim_repository' }

    pim_catalog.repository.attribute_group:
        class: 'Akeneo\Pim\Structure\Bundle\Doctrine\ORM\Repository\AttributeGroupRepository'
        factory: ['@doctrine.orm.entity_manager', 'getRepository']
        arguments: ['%pim_catalog.entity.attribute_group.class%']
        tags:
            - { name: 'pim_repository' }

    pim_catalog.repository.attribute:
        class: 'Akeneo\Pim\Structure\Bundle\Doctrine\ORM\Repository\AttributeRepository'
        factory: ['@doctrine.orm.entity_manager', 'getRepository']
        arguments: ['%pim_catalog.entity.attribute.class%']
        tags:
            - { name: 'pim_repository' }

    pim_catalog.repository.family:
        class: 'Akeneo\Pim\Structure\Bundle\Doctrine\ORM\Repository\FamilyRepository'
        factory: ['@doctrine.orm.entity_manager', 'getRepository']
        arguments: ['%pim_catalog.entity.family.class%']
        tags:
            - { name: 'pim_repository' }

    pim_catalog.repository.family_variant:
        class: 'Akeneo\Pim\Structure\Bundle\Doctrine\ORM\Repository\FamilyVariantRepository'
        factory: ['@doctrine.orm.entity_manager', 'getRepository']
        arguments: ['%pim_catalog.entity.family_variant.class%']
        tags:
            - { name: 'pim_repository' }

    pim_catalog.repository.attribute_requirement:
        class: 'Akeneo\Pim\Structure\Bundle\Doctrine\ORM\Repository\AttributeRequirementRepository'
        factory: ['@doctrine.orm.entity_manager', 'getRepository']
        arguments: ['%pim_catalog.entity.attribute_requirement.class%']
        tags:
            - { name: 'pim_repository' }

    pim_catalog.repository.attribute_option:
        class: 'Akeneo\Pim\Structure\Bundle\Doctrine\ORM\Repository\AttributeOptionRepository'
        factory: ['@doctrine.orm.entity_manager', 'getRepository']
        arguments: ['%pim_catalog.entity.attribute_option.class%']
        tags:
            - { name: 'pim_repository' }

    ### External API
    pim_api.repository.attribute:
        class: 'Akeneo\Pim\Structure\Bundle\Doctrine\ORM\Repository\ExternalApi\AttributeRepository'
        arguments:
            - '@doctrine.orm.entity_manager'
            - '%pim_catalog.entity.attribute.class%'
            - '@pim_catalog.repository.attribute'

    pim_api.repository.family:
        class: 'Akeneo\Pim\Structure\Bundle\Doctrine\ORM\Repository\ExternalApi\FamilyRepository'
        arguments:
            - '@doctrine.orm.entity_manager'
            - '%pim_catalog.entity.family.class%'
            - '@pim_catalog.repository.family'

    pim_api.repository.attribute_group:
        class: 'Akeneo\Pim\Structure\Bundle\Doctrine\ORM\Repository\ExternalApi\AttributeGroupRepository'
        arguments:
            - '@doctrine.orm.entity_manager'
            - '%pim_catalog.entity.attribute_group.class%'
            - '@pim_catalog.repository.attribute_group'

    ### Internal API
    pim_enrich.repository.attribute_group:
        public: true
        class: 'Akeneo\Pim\Structure\Bundle\Doctrine\ORM\Repository\InternalApi\AttributeGroupRepository'
        arguments:
            - '@pim_user.context.user'
            - '@doctrine.orm.entity_manager'
            - '%pim_catalog.entity.attribute_group.class%'

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

    pim_enrich.repository.attribute_group.search:
        class: 'Akeneo\Pim\Structure\Bundle\Doctrine\ORM\Repository\InternalApi\AttributeGroupSearchableRepository'
        arguments:
            - '@doctrine.orm.entity_manager'
            - '%pim_catalog.entity.attribute_group.class%'

    pim_enrich.repository.attribute_option.search:
        class: 'Akeneo\Pim\Structure\Bundle\Doctrine\ORM\Repository\InternalApi\AttributeOptionSearchableRepository'
        arguments:
            - '@doctrine.orm.entity_manager'
            - '%pim_catalog.entity.attribute_option.class%'
            - '@pim_catalog.repository.attribute'

    pim_enrich.repository.attribute.search:
        class: 'Akeneo\Pim\Structure\Bundle\Doctrine\ORM\Repository\InternalApi\AttributeSearchableRepository'
        arguments:
            - '@doctrine.orm.entity_manager'
            - '%pim_catalog.entity.attribute.class%'

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

    pim_enrich.repository.family.search:
        class: 'Akeneo\Pim\Structure\Bundle\Doctrine\ORM\Repository\InternalApi\FamilySearchableRepository'
        arguments:
            - '@doctrine.orm.entity_manager'
            - '%pim_catalog.entity.family.class%'

    pim_enrich.repository.family_variant:
        class: 'Akeneo\Pim\Structure\Bundle\Doctrine\ORM\Repository\InternalApi\FamilyVariantRepository'
        arguments:
            - '@doctrine.orm.entity_manager'
            - '%pim_catalog.entity.family_variant.class%'

    pim_enrich.repository.family_variant.search:
        class: 'Akeneo\Pim\Structure\Bundle\Doctrine\ORM\Repository\InternalApi\FamilyVariantSearchableRepository'
        arguments:
            - '@doctrine.orm.entity_manager'
            - '%pim_catalog.entity.family_variant.class%'

    pim_catalog.repository.group_type:
        class: 'Akeneo\Pim\Structure\Bundle\Doctrine\ORM\Repository\GroupTypeRepository'
        factory: ['@doctrine.orm.entity_manager', 'getRepository']
        arguments: ['%pim_catalog.entity.group_type.class%']
        tags:
            - { name: 'pim_repository' }

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

    pim_enrich.repository.association_type:
        class: 'Akeneo\Pim\Structure\Bundle\Doctrine\ORM\Repository\InternalApi\AssociationTypeRepository'
        arguments:
            - '@doctrine.orm.entity_manager'
            - '%pim_catalog.entity.association_type.class%'

    pim_catalog.repository.category:
        class: 'Akeneo\Tool\Bundle\ClassificationBundle\Doctrine\ORM\Repository\CategoryRepository'
        factory: ['@doctrine.orm.entity_manager', 'getRepository']
        arguments: ['%pim_catalog.entity.category.class%']
        tags:
            - { name: 'pim_repository' }
