Overrides in the OXID eShop

The Connect module uses overrides in the store to detect certain events e.g. the change of an item. Saving an item creates an entry in the makaira_connect_changes table, which signals new data to the import process.

Disable touch hooks

Task

An import process, e.g. from merchandise management, often calls the oxArticle::save() method, triggering redundant write operations (touch) to the makaira_connect_changes table.

Solution

The touch hooks can be deactivated during the import.

<?php>

/* ... */

// instance of oxArticle
$oxArticle = oxNew('oxarticle');

// disable touch on save, delete, ...
$oxArticle->disableMakairaTouch();

/* ... */

// oxArticle is saved
$oxArticle->save();

/* ... */

// oxArticle is saved again
$oxArticle->save();

// call explicit touch for this product
$oxArticle->touch();
Information

The method disableMakairaTouch is provided by the Connect for the models oxArticle, oxCategory, oxManufacturer and oxobject2category and disables the touch when saving or deleting the objects for the duration of the PHP process.