1 package FS::access_user_log;
2 use base qw( FS::Record );
5 #use FS::Record qw( qsearch qsearchs );
10 FS::access_user_log - Object methods for access_user_log records
14 use FS::access_user_log;
16 $record = new FS::access_user_log \%hash;
17 $record = new FS::access_user_log { 'column' => 'value' };
19 $error = $record->insert;
21 $error = $new_record->replace($old_record);
23 $error = $record->delete;
25 $error = $record->check;
29 An FS::access_user_log object represents a backoffice web server log entry.
30 FS::access_user_log inherits from FS::Record. The following fields are
60 Creates a new log entry. To add the log entry to the database, see L<"insert">.
62 Note that this stores the hash reference, not a distinct copy of the hash it
63 points to. You can ask the object for a copy with the I<hash> method.
67 sub table { 'access_user_log'; }
69 =item insert_new_path PATH
71 Adds a log entry for PATH for the current user and timestamp.
76 my( $class, $path ) = @_;
78 return '' unless defined $FS::CurrentUser::CurrentUser;
80 my $self = $class->new( {
81 'usernum' => $FS::CurrentUser::CurrentUser->usernum,
86 my $error = $self->insert;
93 Adds this record to the database. If there is an error, returns the error,
94 otherwise returns false.
98 Delete this record from the database.
100 =item replace OLD_RECORD
102 Replaces the OLD_RECORD with this one in the database. If there is an error,
103 returns the error, otherwise returns false.
107 Checks all fields to make sure this is a valid log entry. If there is
108 an error, returns the error, otherwise returns false. Called by the insert
117 $self->ut_numbern('lognum')
118 || $self->ut_foreign_key('usernum', 'access_user', 'usernum')
119 || $self->ut_text('path')
120 || $self->ut_number('_date')
122 return $error if $error;