<?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="office_brain_solr.product_category_search.class">OfficeBrain\Bundle\SolrBundle\SearchServices\ProductCategoryService</parameter>
        <parameter key="office_brain_solr.client_factory_service.class">OfficeBrain\Bundle\SolrBundle\SearchServices\ClientFactory</parameter>
        <parameter key="office_brain_solr.product_search.class">OfficeBrain\Bundle\SolrBundle\SearchServices\ProductService</parameter>
        <parameter key="office_brain_solr.solr_product_mapping_service">OfficeBrain\Bundle\SolrBundle\Manager\Service\SolrService</parameter>
    </parameters>

    <services>
        <service id="office_brain_solr.client_factory_service"  class="%office_brain_solr.client_factory_service.class%">
            <argument type="service" id="service_container"></argument>
            <argument>%office_brain_solr.default_culture%</argument>
        </service>
        <service id="office_brain_solr.product_search" class="%office_brain_solr.product_search.class%">
            <argument>%office_brain_solr.default_culture%</argument>
            <argument type="service" id="office_brain_solr.client_factory_service" />
            <argument>%office_brain_solr.default_price_qty_range%</argument>
            <argument type="service" id="doctrine.orm.entity_manager"/>
        </service>
        
        <service id="office_brain_solr_service_factory" class="%office_brain_solr.solr_product_mapping_service%"/>
        
        <service id="office_brain_solr_product_mapping_manager" class="%office_brain_solr.solr_product_mapping_service%" scope='request'>
              <factory service="office_brain_solr_service_factory" method="initFactory"/>
              <argument type="service" id="doctrine.orm.entity_manager"/>
              <argument type="service" id="office_brain_product_detail_manager"/>
              <argument type="service" id="office_brain_product_api" />
              <argument type="service" id="request"/>
        </service>
    </services>
</container>
