<?xml version="1.0" ?>

<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">

    <parameters>
        <parameter key="doctrine.orm.configuration.class">Doctrine\ORM\Configuration</parameter>
        <parameter key="doctrine.orm.entity_manager.class">Doctrine\ORM\EntityManager</parameter>

        <!-- cache -->
        <parameter key="doctrine.orm.cache.array.class">Doctrine\Common\Cache\ArrayCache</parameter>
        <parameter key="doctrine.orm.cache.apc.class">Doctrine\Common\Cache\ApcCache</parameter>
        <parameter key="doctrine.orm.cache.memcache.class">Doctrine\Common\Cache\MemcacheCache</parameter>
        <parameter key="doctrine.orm.cache.memcache_host">localhost</parameter>
        <parameter key="doctrine.orm.cache.memcache_port">11211</parameter>
        <parameter key="doctrine.orm.cache.memcache_instance.class">Memcache</parameter>
        <parameter key="doctrine.orm.cache.xcache.class">Doctrine\Common\Cache\XcacheCache</parameter>

        <!-- metadata -->
        <parameter key="doctrine.orm.metadata.driver_chain.class">Doctrine\ORM\Mapping\Driver\DriverChain</parameter>
        <parameter key="doctrine.orm.metadata.annotation.class">Doctrine\ORM\Mapping\Driver\AnnotationDriver</parameter>
        <parameter key="doctrine.orm.metadata.annotation_reader.class">Symfony\Bridge\Doctrine\Annotations\IndexedReader</parameter>
        <parameter key="doctrine.orm.metadata.xml.class">Symfony\Bridge\Doctrine\Mapping\Driver\XmlDriver</parameter>
        <parameter key="doctrine.orm.metadata.yml.class">Symfony\Bridge\Doctrine\Mapping\Driver\YamlDriver</parameter>
        <parameter key="doctrine.orm.metadata.php.class">Doctrine\ORM\Mapping\Driver\PHPDriver</parameter>
        <parameter key="doctrine.orm.metadata.staticphp.class">Doctrine\ORM\Mapping\Driver\StaticPHPDriver</parameter>

        <!-- cache warmer -->
        <parameter key="doctrine.orm.proxy_cache_warmer.class">Symfony\Bridge\Doctrine\CacheWarmer\ProxyCacheWarmer</parameter>

        <!-- form field factory guesser -->
        <parameter key="form.type_guesser.doctrine.class">Symfony\Bridge\Doctrine\Form\DoctrineOrmTypeGuesser</parameter>

        <!-- validator -->
        <parameter key="doctrine.orm.validator.unique.class">Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntityValidator</parameter>
        <parameter key="doctrine.orm.validator_initializer.class">Symfony\Bridge\Doctrine\Validator\EntityInitializer</parameter>
    </parameters>

    <services>
        <!--- Annotation Metadata Reader Service -->
        <service id="doctrine.orm.metadata.annotation_reader" class="%doctrine.orm.metadata.annotation_reader.class%" public="false">
            <argument type="service" id="annotation_reader" />
        </service>

        <service id="doctrine.orm.proxy_cache_warmer" class="%doctrine.orm.proxy_cache_warmer.class%" public="false">
            <tag name="kernel.cache_warmer" />
            <argument type="service" id="doctrine" />
        </service>

        <service id="form.type_guesser.doctrine" class="%form.type_guesser.doctrine.class%">
            <tag name="form.type_guesser" />
            <argument type="service" id="doctrine" />
        </service>

        <service id="form.type.entity" class="Symfony\Bridge\Doctrine\Form\Type\EntityType">
            <tag name="form.type" alias="entity" />
            <argument type="service" id="doctrine" />
        </service>

        <service id="doctrine.orm.configuration" class="%doctrine.orm.configuration.class%" abstract="true" public="false" />

        <service id="doctrine.orm.entity_manager.abstract" class="%doctrine.orm.entity_manager.class%" factory-class="%doctrine.orm.entity_manager.class%" factory-method="create" abstract="true" />

        <!-- validator -->
        <service id="doctrine.orm.validator.unique" class="%doctrine.orm.validator.unique.class%">
            <tag name="validator.constraint_validator" alias="doctrine.orm.validator.unique" />
            <argument type="service" id="doctrine" />
        </service>

        <service id="doctrine.orm.validator_initializer" class="%doctrine.orm.validator_initializer.class%">
            <tag name="validator.initializer" />
            <argument type="service" id="doctrine" />
        </service>
    </services>
</container>
