1 package FS::cust_pkg_option;
2 use base qw(FS::Record);
8 FS::cust_pkg_option - Object methods for cust_pkg_option records
12 use FS::cust_pkg_option;
14 $record = new FS::cust_pkg_option \%hash;
15 $record = new FS::cust_pkg_option { 'column' => 'value' };
17 $error = $record->insert;
19 $error = $new_record->replace($old_record);
21 $error = $record->delete;
23 $error = $record->check;
27 An FS::cust_pkg_option object represents an option key an value for a
28 customer package. FS::cust_pkg_option inherits from
29 FS::Record. The following fields are currently supported:
33 =item optionnum - primary key
50 Creates a new option. To add the option to the database, see L<"insert">.
52 Note that this stores the hash reference, not a distinct copy of the hash it
53 points to. You can ask the object for a copy with the I<hash> method.
57 sub table { 'cust_pkg_option'; }
61 Adds this record to the database. If there is an error, returns the error,
62 otherwise returns false.
68 Delete this record from the database.
72 =item replace OLD_RECORD
74 Replaces the OLD_RECORD with this one in the database. If there is an error,
75 returns the error, otherwise returns false.
81 Checks all fields to make sure this is a valid option. If there is
82 an error, returns the error, otherwise returns false. Called by the insert
91 $self->ut_numbern('optionnum')
92 || $self->ut_foreign_key('pkgnum', 'cust_pkg', 'pkgnum')
93 || $self->ut_text('optionname')
94 || $self->ut_textn('optionvalue')
96 return $error if $error;
107 L<FS::Record>, L<FS::cust_pkg>, schema.html from the base documentation.