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'
52 =item fcc_ds0s - Optional DS0 equivalency number for FCC form 477
62 Creates a new package class. To add the package class to the database, see
67 sub table { 'pkg_class'; }
68 sub _target_table { 'part_pkg'; }
72 $self->ut_numbern('fcc_ds0s')
73 || $self->SUPER::check;
78 Adds this package class to the database. If there is an error, returns the
79 error, otherwise returns false.
83 Deletes this package class from the database. Only package classes with no
84 associated package definitions can be deleted. If there is an error, returns
85 the error, otherwise returns false.
87 =item replace [ OLD_RECORD ]
89 Replaces OLD_RECORD with this one in the database. If there is an error,
90 returns the error, otherwise returns false.
94 Checks all fields to make sure this is a valid package class. If there is an
95 error, returns the error, otherwise returns false. Called by the insert and
102 Returns the pkg_category record associated with this class, or false if there
114 Returns the category name associated with this class, or false if there
123 L<FS::part_pkg>, L<FS::Record>