diff options
author | Dylan William Hardison <dylan@hardison.net> | 2014-04-07 08:41:11 +0200 |
---|---|---|
committer | Dylan William Hardison <dylan@hardison.net> | 2014-04-22 22:37:52 +0200 |
commit | eab44b1aad3f243dd69b1d30519b73a1e537fda2 (patch) | |
tree | 45e67469b8c6905a545dc5f2bd8bbe03bd41ea7c /Bugzilla/BugUserLastVisit.pm | |
parent | 36f56bd9112c2e930fb5bdbee3b5c89334de5247 (diff) | |
download | bugzilla-eab44b1aad3f243dd69b1d30519b73a1e537fda2.tar.gz bugzilla-eab44b1aad3f243dd69b1d30519b73a1e537fda2.tar.xz |
Bug 489028 - Record last-visited time of bugs when logged in
r=glob a=justdave
Diffstat (limited to 'Bugzilla/BugUserLastVisit.pm')
-rw-r--r-- | Bugzilla/BugUserLastVisit.pm | 76 |
1 files changed, 76 insertions, 0 deletions
diff --git a/Bugzilla/BugUserLastVisit.pm b/Bugzilla/BugUserLastVisit.pm new file mode 100644 index 000000000..e8e483405 --- /dev/null +++ b/Bugzilla/BugUserLastVisit.pm @@ -0,0 +1,76 @@ +package Bugzilla::BugUserLastVisit; + +use 5.10.1; +use strict; + +use parent qw(Bugzilla::Object); + +##################################################################### +# Overriden Constants that are used as methods +##################################################################### + +use constant DB_TABLE => 'bug_user_last_visit'; +use constant DB_COLUMNS => qw( id user_id bug_id last_visit_ts ); +use constant UPDATE_COLUMNS => qw( last_visit_ts ); +use constant VALIDATORS => {}; +use constant LIST_ORDER => 'id'; +use constant NAME_FIELD => 'id'; + +# turn off auditing and exclude these objects from memcached +use constant { AUDIT_CREATES => 0, + AUDIT_UPDATES => 0, + AUDIT_REMOVES => 0, + USE_MEMCACHED => 0 }; + +##################################################################### +# Provide accessors for our columns +##################################################################### + +sub id { return $_[0]->{id} } +sub bug_id { return $_[0]->{bug_id} } +sub user_id { return $_[0]->{user_id} } +sub last_visit_ts { return $_[0]->{last_visit_ts} } + +1; +__END__ + +=head1 NAME + +Bugzilla::BugUserLastVisit - Model for BugUserLastVisit bug search data + +=head1 SYNOPSIS + + use Bugzilla::BugUserLastVisit; + + my $lv = Bugzilla::BugUserLastVisit->new($id); + + # Class Functions + $user = Bugzilla::BugUserLastVisit->create({ + bug_id => $bug_id, + user_id => $user_id, + last_visit_ts => $last_visit_ts + }); + +=head1 DESCRIPTION + +This package handles Bugzilla BugUserLastVisit. + +C<Bugzilla::BugUserLastVisit> is an implementation of L<Bugzilla::Object>, and +thus provides all the methods of L<Bugzilla::Object> in addition to the methods +listed below. + +=head1 METHODS + +=head2 Accessor Methods + +=over + +=item C<id> + +=item C<bug_id> + +=item C<user_id> + +=item C<last_visit_ts> + +=back |