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

    <services>
        <defaults public="true" />

        <service id="shopware.form.factory" class="Symfony\Component\Form\FormFactoryInterface">
            <factory class="Shopware\Bundle\FormBundle\FormFactory" method="factory" />
            <argument type="service" id="validator" />
            <argument type="service" id="form.extension" />
        </service>

        <service id="shopware.form.extension.event" class="Shopware\Bundle\FormBundle\Extension\EventExtension">
            <argument type="service" id="Shopware\Components\ContainerAwareEventManager" />

            <tag name="form.type_extension" extended-type="Symfony\Component\Form\Extension\Core\Type\FormType" />
        </service>

        <service id="shopware.form.extension.enlight" class="Symfony\Component\Form\Extension\HttpFoundation\Type\FormTypeHttpFoundationExtension">
            <tag name="form.type_extension" extended-type="Symfony\Component\Form\Extension\Core\Type\FormType" />
        </service>

        <service id="form.extension" class="Symfony\Component\Form\Extension\DependencyInjection\DependencyInjectionExtension" public="false">
            <argument /><!-- All services with tag "form.type" are stored in a service locator by FormPass -->
            <argument type="collection" /><!-- All services with tag "form.type_extension" are stored here by FormPass -->
            <argument type="iterator" /><!-- All services with tag "form.type_guesser" are stored here by FormPass -->
        </service>

        <service id="shopware.form.constraint.exists" class="Shopware\Bundle\FormBundle\Constraints\ExistsValidator">
            <argument type="service" id="Doctrine\DBAL\Connection" />

            <tag name="validator.constraint_validator" alias="shopware.form.constraint.exists" />
        </service>

        <service id="shopware.form.constraint.unique" class="Shopware\Bundle\FormBundle\Constraints\UniqueValidator">
            <argument type="service" id="Doctrine\DBAL\Connection" />

            <tag name="validator.constraint_validator" alias="shopware.form.constraint.unique" />
        </service>

        <service id="shopware.form.string_renderer_service" class="Shopware\Bundle\FormBundle\StringRendererService" />
    </services>
</container>
