2

I am creating extensionpool handlers to save data in multiple tables.

There are total 3 tables :

1 : Sliders

2 : SliderItems

3 : SliderSelectedItems

When I create/update Slider, list of selected slider items displays in TAB like this

enter image description here

I can see which slides are assigned to a slider. Also when I check/uncheck the slider items, record is added to SliderSelectedItems table, which stores only item_id and slider_id.

Now, When I create/update slider items, I can choose multiple slider in which this item will be displayed. Like this,

enter image description here

When I save this, record is added to SliderSelectedItems

To add records in SliderSelectedItems, I have created extensionpool Handlers

<type name="Magento\Framework\EntityManager\Operation\ExtensionPool">
    <arguments>
        <argument name="extensionActions" xsi:type="array">
            <item name="MageSpark\OwlCarouselSlider\Api\Data\SliderInterface" xsi:type="array">
                <item name="read" xsi:type="array">
                    <item name="sliderReader" xsi:type="string">MageSpark\OwlCarouselSlider\Model\ResourceModel\Slider\Relation\ReadHandler</item>
                    <item name="sliderItemReader" xsi:type="string">MageSpark\OwlCarouselSlider\Model\ResourceModel\SliderItem\Relation\ReadHandler</item>
                </item>
                <item name="create" xsi:type="array">
                    <item name="sliderCreator" xsi:type="string">MageSpark\OwlCarouselSlider\Model\ResourceModel\Slider\Relation\SaveHandler</item>
                    <item name="sliderItemCreator" xsi:type="string">MageSpark\OwlCarouselSlider\Model\ResourceModel\SliderItem\Relation\SaveHandler</item>
                </item>
                <item name="update" xsi:type="array">
                    <item name="sliderUpdater" xsi:type="string">MageSpark\OwlCarouselSlider\Model\ResourceModel\Slider\Relation\SaveHandler</item>
                    <item name="sliderItemUpdater" xsi:type="string">MageSpark\OwlCarouselSlider\Model\ResourceModel\SliderItem\Relation\SaveHandler</item>
                </item>
            </item>
        </argument>
    </arguments>
</type>

Now, when I am saving the slider, it works fine. But when I save the slider item, SAVE HANDLER of SLIDER is called. It conflicts my slider item save/read handler.

I am confused, any help would be appriciated. Thank you.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.