<?xml version="1.0"?>
<!--
/**
 * Blueskytechco
 * 
 * NOTICE OF LICENSE
 * 
 * This source file is subject to the Blueskytechco.com license that is
 * available through the world-wide-web at this URL:
 * http://www.blueskytechco.com/license-agreement.html
 * 
 * DISCLAIMER
 * 
 * Do not edit or add to this file if you wish to upgrade this extension to newer
 * version in the future.
 * 
 * @category   Blueskytechco
 * @package    Rokanthemes_Brand
 * @copyright  Copyright (c) 2014 Blueskytechco (http://www.blueskytechco.com/)
 * @license    http://www.blueskytechco.com/LICENSE-1.0.html
 */
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
	<preference for="Magento\Catalog\Model\Layer" type="Rokanthemes\Brand\Model\Layer" />
	<type name="Magento\Framework\View\Element\UiComponent\DataProvider\CollectionFactory">
		<arguments>
			<argument name="collections" xsi:type="array">
				<item name="brand_listing_data_source" xsi:type="string">Rokanthemes\Brand\Model\ResourceModel\Brand\Grid\Collection</item>
			</argument>
		</arguments>
	</type>
	<type name="Rokanthemes\Brand\Model\ResourceModel\Brand\Grid\Collection">
		<arguments>
			<argument name="mainTable" xsi:type="string">rokanthemes_brand</argument>
			<argument name="eventPrefix" xsi:type="string">rokanthemes_brand_grid_collection</argument>
			<argument name="eventObject" xsi:type="string">brand_grid_collection</argument>
			<argument name="resourceModel" xsi:type="string">Rokanthemes\Brand\Model\ResourceModel\Brand</argument>
		</arguments>
	</type>
	<type name="Magento\Framework\View\Element\UiComponent\DataProvider\CollectionFactory">
		<arguments>
			<argument name="collections" xsi:type="array">
				<item name="group_listing_data_source" xsi:type="string">Rokanthemes\Brand\Model\ResourceModel\Group\Grid\Collection</item>
			</argument>
		</arguments>
	</type>
	<type name="Rokanthemes\Brand\Model\ResourceModel\Group\Grid\Collection">
		<arguments>
			<argument name="mainTable" xsi:type="string">rokanthemes_brand_group</argument>
			<argument name="eventPrefix" xsi:type="string">rokanthemes_brand_grid_collection</argument>
			<argument name="eventObject" xsi:type="string">group_grid_collection</argument>
			<argument name="resourceModel" xsi:type="string">Rokanthemes\Brand\Model\ResourceModel\Brand</argument>
		</arguments>
	</type>
	<type name="Rokanthemes\Brand\Model\Layer\Resolver">
		<arguments>
			<argument name="layersPool" xsi:type="array">
				<item name="brand" xsi:type="string">Rokanthemes\Brand\Model\Layer\Brand</item>
			</argument>
		</arguments>
	</type>
	<type name="Rokanthemes\Brand\Model\Layer\Brand">
		<arguments>
			<argument name="context" xsi:type="object">Magento\Catalog\Model\Layer\Category\Context</argument>
		</arguments>
	</type>
	<type name="Rokanthemes\Brand\Block\Brand\Product\ListProduct">
		<arguments>
			<argument name="layerResolver" xsi:type="object">Rokanthemes\Brand\Model\Layer\Resolver</argument>
		</arguments>
	</type>
	<virtualType name="BrandGirdFilterPool" type="Magento\Framework\View\Element\UiComponent\DataProvider\FilterPool">
        <arguments>
            <argument name="appliers" xsi:type="array">
                <item name="regular" xsi:type="object">Magento\Framework\View\Element\UiComponent\DataProvider\RegularFilter</item>
                <item name="fulltext" xsi:type="object">Magento\Framework\View\Element\UiComponent\DataProvider\FulltextFilter</item>
            </argument>
        </arguments>
    </virtualType>
	<virtualType name="BrandGridDataProvider" type="Rokanthemes\Brand\Ui\DataProvider\Brand\BrandDataProvider">
        <arguments>
            <argument name="filterPool" xsi:type="object" shared="false">BrandGirdFilterPool</argument>
        </arguments>
    </virtualType>
    <virtualType name="GroupGridDataProvider" type="Rokanthemes\Brand\Ui\DataProvider\Brand\GroupDataProvider">
        <arguments>
            <argument name="filterPool" xsi:type="object" shared="false">BrandGirdFilterPool</argument>
        </arguments>
    </virtualType>
	<preference for="Magento\Catalog\Model\Layer\ContextInterface" type="Magento\Catalog\Model\Layer\Context" />
    <preference for="Magento\Catalog\Model\Layer\ItemCollectionProviderInterface" type="Magento\Catalog\Model\Layer\Category\ItemCollectionProvider" />
    <preference for="Magento\Catalog\Model\Layer\StateKeyInterface" type="Magento\Catalog\Model\Layer\Category\StateKey" />
    <preference for="Magento\Catalog\Model\Layer\CollectionFilterInterface" type="Magento\Catalog\Model\Layer\Category\CollectionFilter" />
    <preference for="Magento\Catalog\Model\Layer\FilterableAttributeListInterface" type="Magento\Catalog\Model\Layer\Category\FilterableAttributeList" />
    <preference for="Magento\Catalog\Model\Layer\AvailabilityFlagInterface" type="Magento\Catalog\Model\Layer\Category\AvailabilityFlag" />
    <preference for="Magento\Catalog\Model\ResourceModel\Layer\Filter\Price" type="Rokanthemes\Brand\Model\ResourceModel\Layer\Filter\Price" />
</config>