NAME

    pkg('Contrib') - storage and retrieval of contributor data


SYNOPSIS

    # create new contributor object
    my $contrib = pkg('Contrib')->new(  prefix => 'Mr.',
                                        first => 'Matthew',
                                        middle => 'Charles',
                                        last => 'Vella',
                                        email => 'mvella@thepirtgroup.com',
                                        phone => '111-222-3333',
                                        bio => 'This is my bio.',
                                        url => 'http://www.myurlhere.com' );
    # add contributor types (lets pretend contrib_type 1 is 'Writer' and 
    # type 3 is 'Photographer')
    $contrib->contrib_type_ids(1,3);
    # save this contributor to the database
    $contrib->save();
    # now that it is saved we can get its id
    my $contrib_id = $contrib->contrib_id();
    # find this contributor by id
    my @contribs = pkg('Contrib')->find( contrib_id => $contrib_id );
    # list contributor type ids (will return 1,3)
    @contrib_type_ids = $contribs[0]->contrib_type_ids();
    # list contrib type names (will return 'Writer', 'Photographer');
    @contrib_type_names = $contribs[0]->contrib_type_names();
    # change contributor contrib type ids, effectively removing writer type (1)
    $contribs[0]->contrib_type_ids(3);
    # save contributor, making changes permanent
    $contribs[0]->save();
    # delete contributor
    $contribs[0]->delete();


DESCRIPTION

This class handles the storage and retrieval of contributor data to/from the database. Contributor type ids come from Krang::AdminPrefs (??), but are associated to contributors here.


INTERFACE

METHODS