<?xml version="1.0" encoding="UTF-8"?>

<!--

 This file is part of the Sylius package.

 (c) Sylius Sp. z o.o.

 For the full copyright and license information, please view the LICENSE
 file that was distributed with this source code.

-->

<container xmlns="http://symfony.com/schema/dic/services" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
    <services>
        <service id="Sylius\Bundle\TaxonomyBundle\Repository\TaxonTreeRepositoryInterface" class="Sylius\Bundle\TaxonomyBundle\Repository\TaxonTreeRepository" decorates="sylius.repository.tree.taxon">
            <argument type="service" id="Sylius\Bundle\TaxonomyBundle\Repository\TaxonTreeRepositoryInterface.inner" />
        </service>

        <service id="sylius.repository.tree.taxon" class="Gedmo\Tree\Entity\Repository\NestedTreeRepository">
            <argument type="service" id="doctrine.orm.entity_manager" />
            <argument type="service">
                <service class="Doctrine\ORM\Mapping\ClassMetadata">
                    <factory service="doctrine.orm.entity_manager" method="getClassMetadata" />
                    <argument>%sylius.model.taxon.class%</argument>
                </service>
            </argument>
        </service>
    </services>
</container>
