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
61 Creates a new log entry. To add the log entry to the database, see L<"insert">.
63 Note that this stores the hash reference, not a distinct copy of the hash it
64 points to. You can ask the object for a copy with the I<hash> method.
68 sub table { 'access_user_log'; }
70 =item insert_new_path PATH
72 Adds a log entry for PATH for the current user and timestamp.
77 my( $class, $path, $render_seconds ) = @_;
79 return '' unless defined $FS::CurrentUser::CurrentUser;
81 my $self = $class->new( {
82 'usernum' => $FS::CurrentUser::CurrentUser->usernum,
85 'render_seconds' => $render_seconds,
88 my $error = $self->insert;
95 Adds this record to the database. If there is an error, returns the error,
96 otherwise returns false.
100 Delete this record from the database.
102 =item replace OLD_RECORD
104 Replaces the OLD_RECORD with this one in the database. If there is an error,
105 returns the error, otherwise returns false.
109 Checks all fields to make sure this is a valid log entry. If there is
110 an error, returns the error, otherwise returns false. Called by the insert
119 $self->ut_numbern('lognum')
120 || $self->ut_foreign_key('usernum', 'access_user', 'usernum')
121 || $self->ut_text('path')
122 || $self->ut_number('_date')
123 || $self->ut_numbern('render_seconds')
125 return $error if $error;