1 package FS::saved_search_option;
2 use base qw( FS::Record );
5 use FS::Record qw( qsearch qsearchs );
9 FS::saved_search_option - Object methods for saved_search_option records
13 use FS::saved_search_option;
15 $record = new FS::saved_search_option \%hash;
16 $record = new FS::saved_search_option { 'column' => 'value' };
18 $error = $record->insert;
20 $error = $new_record->replace($old_record);
22 $error = $record->delete;
24 $error = $record->check;
28 An FS::saved_search_option object represents a CGI parameter for a report
29 saved in L<FS::saved_search>. FS::saved_search_option inherits from
30 FS::Record. The following fields are currently supported:
59 Creates a new parameter. To add the record to the database, see
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 # the new method can be inherited from FS::Record, if a table method is defined
69 sub table { 'saved_search_option'; }
73 Adds this record to the database. If there is an error, returns the error,
74 otherwise returns false.
78 Delete this record from the database.
80 =item replace OLD_RECORD
82 Replaces the OLD_RECORD with this one in the database. If there is an error,
83 returns the error, otherwise returns false.
87 Checks all fields to make sure this is a valid example. If there is
88 an error, returns the error, otherwise returns false. Called by the insert
93 # the check method should currently be supplied - FS::Record contains some
94 # data checking routines
99 # unpack these from the format used by CGI
100 my $optionvalue = $self->optionvalue;
101 $optionvalue =~ s/\0/\n/g;
104 $self->ut_numbern('optionnum')
105 || $self->ut_number('searchnum')
106 # || $self->ut_foreign_key('searchnum', 'saved_search', 'searchnum')
107 || $self->ut_text('optionname')
108 || $self->ut_textn('optionvalue')
110 return $error if $error;