1 package FS::cust_pkg_option;
5 use FS::Record qw( qsearch qsearchs );
11 FS::cust_pkg_option - Object methods for cust_pkg_option records
15 use FS::cust_pkg_option;
17 $record = new FS::cust_pkg_option \%hash;
18 $record = new FS::cust_pkg_option { 'column' => 'value' };
20 $error = $record->insert;
22 $error = $new_record->replace($old_record);
24 $error = $record->delete;
26 $error = $record->check;
30 An FS::cust_pkg_option object represents an option key an value for a
31 customer package. FS::cust_pkg_option inherits from
32 FS::Record. The following fields are currently supported:
36 =item optionnum - primary key
53 Creates a new option. To add the option to the database, see L<"insert">.
55 Note that this stores the hash reference, not a distinct copy of the hash it
56 points to. You can ask the object for a copy with the I<hash> method.
60 sub table { 'cust_pkg_option'; }
64 Adds this record to the database. If there is an error, returns the error,
65 otherwise returns false.
71 Delete this record from the database.
75 =item replace OLD_RECORD
77 Replaces the OLD_RECORD with this one in the database. If there is an error,
78 returns the error, otherwise returns false.
84 Checks all fields to make sure this is a valid option. If there is
85 an error, returns the error, otherwise returns false. Called by the insert
94 $self->ut_numbern('optionnum')
95 || $self->ut_foreign_key('pkgnum', 'cust_pkg', 'pkgnum')
96 || $self->ut_text('optionname')
97 || $self->ut_textn('optionvalue')
99 return $error if $error;
110 L<FS::Record>, L<FS::cust_pkg>, schema.html from the base documentation.