2 use base qw( FS::Record );
8 FS::type_pkgs - Object methods for type_pkgs records
14 $record = new FS::type_pkgs \%hash;
15 $record = new FS::type_pkgs { 'column' => 'value' };
17 $error = $record->insert;
19 $error = $new_record->replace($old_record);
21 $error = $record->delete;
23 $error = $record->check;
27 An FS::type_pkgs record links an agent type (see L<FS::agent_type>) to a
28 billing item definition (see L<FS::part_pkg>). FS::type_pkgs inherits from
29 FS::Record. The following fields are currently supported:
33 =item typepkgnum - primary key
35 =item typenum - Agent type, see L<FS::agent_type>
37 =item pkgpart - Billing item definition, see L<FS::part_pkg>
47 Create a new record. To add the record to the database, see L<"insert">.
51 sub table { 'type_pkgs'; }
55 Adds this record to the database. If there is an error, returns the error,
56 otherwise returns false.
60 Deletes this record from the database. If there is an error, returns the
61 error, otherwise returns false.
63 =item replace OLD_RECORD
65 Replaces OLD_RECORD with this one in the database. If there is an error,
66 returns the error, otherwise returns false.
70 Checks all fields to make sure this is a valid record. If there is an error,
71 returns the error, otherwise returns false. Called by the insert and replace
80 $self->ut_numbern('typepkgnum')
81 || $self->ut_foreign_key('typenum', 'agent_type', 'typenum' )
82 || $self->ut_foreign_key('pkgpart', 'part_pkg', 'pkgpart' )
84 return $error if $error;
91 Returns the FS::part_pkg object associated with this record.
95 Returns the FS::agent_type object associated with this record.
105 L<FS::Record>, L<FS::agent_type>, L<FS::part_pkg>, schema.html from the base