7 use FS::Record qw( qsearchs );
13 FS::msgcat - Object methods for message catalog entries
19 $record = new FS::msgcat \%hash;
20 $record = new FS::msgcat { 'column' => 'value' };
22 $error = $record->insert;
24 $error = $new_record->replace($old_record);
26 $error = $record->delete;
28 $error = $record->check;
32 An FS::msgcat object represents an message catalog entry. FS::msgcat inherits
33 from FS::Record. The following fields are currently supported:
37 =item msgnum - primary key
39 =item msgcode - Error code
47 If you just want to B<use> message catalogs, see L<FS::Msgcat>.
55 Creates a new example. To add the example to the database, see L<"insert">.
57 Note that this stores the hash reference, not a distinct copy of the hash it
58 points to. You can ask the object for a copy with the I<hash> method.
62 # the new method can be inherited from FS::Record, if a table method is defined
64 sub table { 'msgcat'; }
68 Adds this record to the database. If there is an error, returns the error,
69 otherwise returns false.
73 # the insert method can be inherited from FS::Record
77 Delete this record from the database.
81 # the delete method can be inherited from FS::Record
83 =item replace OLD_RECORD
85 Replaces the OLD_RECORD with this one in the database. If there is an error,
86 returns the error, otherwise returns false.
90 # the replace method can be inherited from FS::Record
94 Checks all fields to make sure this is a valid example. If there is
95 an error, returns the error, otherwise returns false. Called by the insert
100 # the check method should currently be supplied - FS::Record contains some
101 # data checking routines
107 $self->ut_numbern('msgnum')
108 || $self->ut_text('msgcode')
109 || $self->ut_text('msg')
111 return $error if $error;
113 $self->locale =~ /^([\w\@]+)$/ or return "illegal locale: ". $self->locale;
127 L<FS::Msgcat>, L<FS::Record>, schema.html from the base documentation.