diff --git a/etc/di.xml b/etc/di.xml new file mode 100755 index 0000000000000000000000000000000000000000..ccea2bf0c8ca8559bbd9c5ab3d1f742ec984c648 --- /dev/null +++ b/etc/di.xml @@ -0,0 +1,90 @@ +<?xml version="1.0"?> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> + <preference for="NicolasBejean\CategoryWidget\Api\Data\CategoryWidgetSearchResultsInterface" type="Magento\Framework\Api\SearchResults" /> + <preference for="NicolasBejean\CategoryWidget\Api\GetCategoryWidgetByIdentifierInterface" type="NicolasBejean\CategoryWidget\Model\GetCategoryWidgetByIdentifier" /> + <preference for="NicolasBejean\CategoryWidget\Api\Data\CategoryWidgetInterface" type="NicolasBejean\CategoryWidget\Model\CategoryWidget" /> + <preference for="NicolasBejean\CategoryWidget\Api\CategoryWidgetRepositoryInterface" type="NicolasBejean\CategoryWidget\Model\CategoryWidgetRepository" /> + + <type name="Magento\Framework\View\Element\UiComponent\DataProvider\CollectionFactory"> + <arguments> + <argument name="collections" xsi:type="array"> + <item name="categorywidget_categorywidget_listing_data_source" xsi:type="string">NicolasBejean\CategoryWidget\Model\ResourceModel\CategoryWidget\Grid\Collection</item> + </argument> + </arguments> + </type> + + <type name="Magento\Framework\Model\Entity\RepositoryFactory"> + <arguments> + <argument name="entities" xsi:type="array"> + <item name="NicolasBejean\CategoryWidget\Api\Data\CategoryWidgetInterface" xsi:type="string">NicolasBejean\CategoryWidget\Api\CategoryWidgetRepositoryInterface</item> + </argument> + </arguments> + </type> + + <type name="Magento\Framework\EntityManager\MetadataPool"> + <arguments> + <argument name="metadata" xsi:type="array"> + <item name="NicolasBejean\CategoryWidget\Api\Data\CategoryWidgetInterface" xsi:type="array"> + <item name="entityTableName" xsi:type="string">nicolasbejean_categorywidget</item> + <item name="identifierField" xsi:type="string">entity_id</item> + </item> + </argument> + </arguments> + </type> + + <type name="Magento\Framework\EntityManager\Operation\ExtensionPool"> + <arguments> + <argument name="extensionActions" xsi:type="array"> + <item name="NicolasBejean\CategoryWidget\Api\Data\CategoryWidgetInterface" xsi:type="array"> + <item name="read" xsi:type="array"> + <item name="storeReader" xsi:type="string">NicolasBejean\CategoryWidget\Model\ResourceModel\CategoryWidget\Relation\Store\ReadHandler</item> + </item> + <item name="create" xsi:type="array"> + <item name="storeCreator" xsi:type="string">NicolasBejean\CategoryWidget\Model\ResourceModel\CategoryWidget\Relation\Store\SaveHandler</item> + </item> + <item name="update" xsi:type="array"> + <item name="storeUpdater" xsi:type="string">NicolasBejean\CategoryWidget\Model\ResourceModel\CategoryWidget\Relation\Store\SaveHandler</item> + </item> + </item> + </argument> + </arguments> + </type> + + <type name="Magento\Framework\EntityManager\HydratorPool"> + <arguments> + <argument name="hydrators" xsi:type="array"> + <item name="NicolasBejean\CategoryWidget\Api\Data\CategoryWidgetInterface" xsi:type="string">Magento\Framework\EntityManager\AbstractModelHydrator</item> + </argument> + </arguments> + </type> + + <type name="NicolasBejean\CategoryWidget\Model\ResourceModel\CategoryWidget\Grid\Collection"> + <arguments> + <argument name="mainTable" xsi:type="string">nicolasbejean_categorywidget</argument> + <argument name="eventPrefix" xsi:type="string">categorywidget_grid_collection</argument> + <argument name="eventObject" xsi:type="string">ategorywidget_grid_collection</argument> + <argument name="resourceModel" xsi:type="string">NicolasBejean\CategoryWidget\Model\ResourceModel\CategoryWidget</argument> + </arguments> + </type> + <virtualType name="NicolasBejean\CategoryWidget\Model\Api\SearchCriteria\CollectionProcessor\CategoryWidgetFilterProcessor" type="Magento\Framework\Api\SearchCriteria\CollectionProcessor\FilterProcessor"> + <arguments> + <argument name="customFilters" xsi:type="array"> + <item name="store_id" xsi:type="object">NicolasBejean\CategoryWidget\Model\Api\SearchCriteria\CollectionProcessor\FilterProcessor\CategoryWidgetStoreFilter</item> + </argument> + </arguments> + </virtualType> + <virtualType name="NicolasBejean\CategoryWidget\Model\Api\SearchCriteria\CategoryWidgetCollectionProcessor" type="Magento\Framework\Api\SearchCriteria\CollectionProcessor"> + <arguments> + <argument name="processors" xsi:type="array"> + <item name="filters" xsi:type="object">NicolasBejean\CategoryWidget\Model\Api\SearchCriteria\CollectionProcessor\CategoryWidgetFilterProcessor</item> + <item name="sorting" xsi:type="object">Magento\Framework\Api\SearchCriteria\CollectionProcessor\SortingProcessor</item> + <item name="pagination" xsi:type="object">Magento\Framework\Api\SearchCriteria\CollectionProcessor\PaginationProcessor</item> + </argument> + </arguments> + </virtualType> + <type name="NicolasBejean\CategoryWidget\Model\CategoryWidgetRepository"> + <arguments> + <argument name="collectionProcessor" xsi:type="object">NicolasBejean\CategoryWidget\Model\Api\SearchCriteria\CategoryWidgetCollectionProcessor</argument> + </arguments> + </type> +</config>