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

<!-- src/Acme/DemoBundle/Resources/config/services.xml -->
<parameters>
    <parameter key="platform.entity.user.class">Acme\DemoBundle\Entity\User</parameter>
    <parameter key="platform.user.provider.class">Acme\DemoBundle\Provider\UserProvider</parameter>
</parameters>

<services>
        <service id="twig.extension.acme.demo" class="Acme\DemoBundle\Twig\Extension\DemoExtension" public="false">
            <tag name="twig.extension" />
            <argument type="service" id="twig.loader" />
        </service>

        <service id="acme.demo.listener" class="Acme\DemoBundle\EventListener\ControllerListener">
            <tag name="kernel.event_listener" event="kernel.controller" method="onKernelController" />
            <argument type="service" id="twig.extension.acme.demo" />
        </service>

    <service id="platform.user.manager" class="Doctrine\ORM\EntityManager"
             factory-service="doctrine" factory-method="getManagerForClass">
        <argument>%platform.entity.user.class%</argument>
    </service>

    <service id="platform.user.repository"
             class="Acme\DemoBundle\Repository\UserRepository"
             factory-service="platform.user.manager" factory-method="getRepository">
        <argument>%platform.entity.user.class%</argument>
    </service>

    <service id="platform.user.provider" class="%platform.user.provider.class%">
        <argument type="service" id="platform.user.repository" />
    </service>
</services>

</container>
