NAME

Krang::History - records historical events for krang objects


SYNOPSIS

    use Krang::ClassLoader History => qw( add_history );
    # record that a story was created (user_id pulled from session, 
    # object id and type from object passed in)
    add_history(    object => $story, 
                    action => 'new',
               );
    # record that story was saved (user_id pulled from session, 
    # object id, type and version from object passed in)
    add_history(    object => $story, 
                    action => 'save',
               );
    # record that story was checked in to desk 2 (user_id pulled 
    # from session, object id and type from object passed in)
    add_history(    object => $story, 
                    action => 'checkin'
                    desk_id => '2' 
                );
    # record that template was deployed (user_id pulled from session, 
    # object id and type from object passed in)
    add_history(    object => $template,
                    action => 'deploy',
               );
    
    # find and return all events for story 
    # (object id and type from object passed in)
    my @events = pkg('History')->find(  object => $story
                                     );
    # delete all history for media object 
    pkg('History')->delete( object => $media,
                          );


DESCRIPTION

This class handles the storage and retrieval of historical events in a Krang object's life. Three interface methods exist- add_history, find, and delete.


INTERFACE

METHODS