5 use base qw( FS::class_Common );
11 FS::pkg_class - Object methods for pkg_class records
17 $record = new FS::pkg_class \%hash;
18 $record = new FS::pkg_class { 'column' => 'value' };
20 $error = $record->insert;
22 $error = $new_record->replace($old_record);
24 $error = $record->delete;
26 $error = $record->check;
30 An FS::pkg_class object represents an package class. Every package definition
31 (see L<FS::part_pkg>) has, optionally, a package class. FS::pkg_class inherits
32 from FS::Record. The following fields are currently supported:
38 primary key (assigned automatically for new package classes)
42 Text name of this package class
46 Number of associated pkg_category (see L<FS::pkg_category>)
50 Disabled flag, empty or 'Y'
60 Creates a new package class. To add the package class to the database, see
65 sub table { 'pkg_class'; }
66 sub _target_table { 'part_pkg'; }
70 Adds this package class to the database. If there is an error, returns the
71 error, otherwise returns false.
75 Deletes this package class from the database. Only package classes with no
76 associated package definitions can be deleted. If there is an error, returns
77 the error, otherwise returns false.
79 =item replace [ OLD_RECORD ]
81 Replaces OLD_RECORD with this one in the database. If there is an error,
82 returns the error, otherwise returns false.
86 Checks all fields to make sure this is a valid package class. If there is an
87 error, returns the error, otherwise returns false. Called by the insert and
94 Returns the pkg_category record associated with this class, or false if there
106 Returns the category name associated with this class, or false if there
115 L<FS::part_pkg>, L<FS::Record>