backup the schema for tables we don't need the data from. RT#85959
[freeside.git] / FS / FS / access_user_session_log.pm
1 package FS::access_user_session_log;
2 use base qw( FS::Record );
3
4 use strict;
5 #use FS::Record qw( qsearch qsearchs );
6
7 =head1 NAME
8
9 FS::access_user_session_log - Object methods for access_user_session_log records
10
11 =head1 SYNOPSIS
12
13   use FS::access_user_session_log;
14
15   $record = new FS::access_user_session_log \%hash;
16   $record = new FS::access_user_session_log { 'column' => 'value' };
17
18   $error = $record->insert;
19
20   $error = $new_record->replace($old_record);
21
22   $error = $record->delete;
23
24   $error = $record->check;
25
26 =head1 DESCRIPTION
27
28 An FS::access_user_session_log object represents an log of an employee session.
29 FS::access_user_session_log inherits from FS::Record.  The following fields
30 are currently supported:
31
32 =over 4
33
34 =item sessionlognum
35
36 primary key
37
38 =item usernum
39
40 usernum
41
42 =item start_date
43
44 start_date
45
46 =item last_date
47
48 last_date
49
50 =item logout_date
51
52 logout_date
53
54 =item logout_type
55
56 logout_type
57
58
59 =back
60
61 =head1 METHODS
62
63 =over 4
64
65 =item new HASHREF
66
67 Creates a new log entry.  To add the entry to the database, see L<"insert">.
68
69 Note that this stores the hash reference, not a distinct copy of the hash it
70 points to.  You can ask the object for a copy with the I<hash> method.
71
72 =cut
73
74 sub table { 'access_user_session_log'; }
75
76 =item insert
77
78 Adds this record to the database.  If there is an error, returns the error,
79 otherwise returns false.
80
81 =item delete
82
83 Delete this record from the database.
84
85 =item replace OLD_RECORD
86
87 Replaces the OLD_RECORD with this one in the database.  If there is an error,
88 returns the error, otherwise returns false.
89
90 =item check
91
92 Checks all fields to make sure this is a valid log entry.  If there is
93 an error, returns the error, otherwise returns false.  Called by the insert
94 and replace methods.
95
96 =cut
97
98 sub check {
99   my $self = shift;
100
101   my $error = 
102     $self->ut_number('usernum')
103     || $self->ut_numbern('start_date')
104     || $self->ut_numbern('last_date')
105     || $self->ut_numbern('logout_date')
106     || $self->ut_text('logout_type')
107   ;
108   return $error if $error;
109
110   $self->SUPER::check;
111 }
112
113 =back
114
115 =head1 BUGS
116
117 =head1 SEE ALSO
118
119 L<FS::Record>
120
121 =cut
122
123 1;
124