Track any object favorites automatically
Add record to sys_object_favorite table to track object favorites, to record favorites just create this class instance with your object id, for example:
Description of sys_object_favorite table fields:
`name` - system name, it is better to use unique module prefix here, lowercase and all spaces are underscored
`table_track` - table to track favorites
`table_lists` - table with lists
`is_on` - is the system activated
`trigger_table` - table where you need to update favorites field
`trigger_field_id` - table field id to unique determine object
`trigger_field_count` - table field where total favorites number is stored
`class_name` - your custom
class name,
if you overrride default class
`class_file` - your custom class path
Structure of the track table is the following:
CREATE TABLE `my_favorites_track` (
`object_id` int(11) NOT NULL default '0', -- this field type must be exact as your object id type
`author_id` int(11) NOT NULL default '0', -- favoring user profile id
`date` int(11) NOT NULL default '0', -- timestamp of last recorded view
KEY `id` (`object_id`,`author_id`)
);