HelloWorld - part 8 watchdog,recent,favorites

From EPESI framework documentation
Jump to: navigation, search


Watchdog is a module that informs you about changes made by other users to records that you observe. To allow your module to support watchdog you must add a watchdog_label function to your Common file :

    public static function watchdog_label($rid = null, $events = array(), $details = true) {
        return Utils_RecordBrowserCommon::watchdog_label(
            'HelloWorld',
            __('HelloWorld'),
            $rid,
            $events,
            'text',
            $details
        );
    }

The 'text' string is key here, it is the field from your recordset that will be displayed in watchdog. Before users can watch changes to records in your module you have to enable watchdog. In your install file add the line below:

Utils_RecordBrowserCommon::enable_watchdog('HelloWorld', array('Custom_HelloWorldCommon','watchdog_label'));

Custom_HelloWorldCommon represents the path to the modules common file. Reinstall your module. Now you can track any changes made by other users to records in HelloWorld.

Watchdog.png

If you do not know the basic concepts of Watchdog read this tutorial.


Download: Get full tutorial here


NEXT >