1 package FS::log_context;
4 use base qw( FS::Record );
5 use FS::Record qw( qsearch qsearchs );
16 upgrade_taxable_billpkgnum
21 FS::log_context - Object methods for log_context records
27 $record = new FS::log_context \%hash;
28 $record = new FS::log_context { 'column' => 'value' };
30 $error = $record->insert;
32 $error = $new_record->replace($old_record);
34 $error = $record->delete;
36 $error = $record->check;
40 An FS::log_context object represents a context tag attached to a log entry
41 (L<FS::log>). FS::log_context inherits from FS::Record. The following
42 fields are currently supported:
46 =item logcontextnum - primary key
48 =item lognum - lognum (L<FS::log> foreign key)
50 =item context - context
60 Creates a new context tag. To add the example to the database, see
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 # the new method can be inherited from FS::Record, if a table method is defined
70 sub table { 'log_context'; }
74 Adds this record to the database. If there is an error, returns the error,
75 otherwise returns false.
79 # the insert method can be inherited from FS::Record
83 Delete this record from the database.
87 # the delete method can be inherited from FS::Record
89 =item replace OLD_RECORD
91 Replaces the OLD_RECORD with this one in the database. If there is an error,
92 returns the error, otherwise returns false.
96 # the replace method can be inherited from FS::Record
100 Checks all fields to make sure this is a valid example. If there is
101 an error, returns the error, otherwise returns false. Called by the insert
106 # the check method should currently be supplied - FS::Record contains some
107 # data checking routines
113 $self->ut_numbern('logcontextnum')
114 || $self->ut_number('lognum')
115 || $self->ut_enum('context', \@contexts)
117 return $error if $error;
130 Returns a list of all valid contexts.
134 sub contexts { @contexts }
142 L<FS::Log>, L<FS::Record>, schema.html from the base documentation.