5 use FS::Record qw( qsearchs );
9 @ISA = qw( FS::Record );
13 FS::type_pkgs - Object methods for type_pkgs records
19 $record = new FS::type_pkgs \%hash;
20 $record = new FS::type_pkgs { 'column' => 'value' };
22 $error = $record->insert;
24 $error = $new_record->replace($old_record);
26 $error = $record->delete;
28 $error = $record->check;
32 An FS::type_pkgs record links an agent type (see L<FS::agent_type>) to a
33 billing item definition (see L<FS::part_pkg>). FS::type_pkgs inherits from
34 FS::Record. The following fields are currently supported:
38 =item typenum - Agent type, see L<FS::agent_type>
40 =item pkgpart - Billing item definition, see L<FS::part_pkg>
50 Create a new record. To add the record to the database, see L<"insert">.
54 sub table { 'type_pkgs'; }
58 Adds this record to the database. If there is an error, returns the error,
59 otherwise returns false.
63 Deletes this record from the database. If there is an error, returns the
64 error, otherwise returns false.
66 =item replace OLD_RECORD
68 Replaces OLD_RECORD with this one in the database. If there is an error,
69 returns the error, otherwise returns false.
73 Checks all fields to make sure this is a valid record. If there is an error,
74 returns the error, otherwise returns false. Called by the insert and replace
83 $self->ut_number('typenum')
84 || $self->ut_number('pkgpart')
86 return $error if $error;
88 return "Unknown typenum"
89 unless qsearchs( 'agent_type', { 'typenum' => $self->typenum } );
91 return "Unknown pkgpart"
92 unless qsearchs( 'part_pkg', { 'pkgpart' => $self->pkgpart } );
99 Returns the FS::part_pkg object associated with this record.
105 qsearchs( 'part_pkg', { 'pkgpart' => $self->pkgpart } );
114 $Id: type_pkgs.pm,v 1.1.14.1 2002-10-04 12:56:35 ivan Exp $
120 L<FS::Record>, L<FS::agent_type>, L<FS::part_pkgs>, schema.html from the base