1 package FS::part_pkg_vendor;
4 use base qw( FS::Record );
5 use FS::Record qw( qsearch qsearchs );
9 FS::part_pkg_vendor - Object methods for part_pkg_vendor records
13 use FS::part_pkg_vendor;
15 $record = new FS::part_pkg_vendor \%hash;
16 $record = new FS::part_pkg_vendor { 'column' => 'value' };
18 $error = $record->insert;
20 $error = $new_record->replace($old_record);
22 $error = $record->delete;
24 $error = $record->check;
28 An FS::part_pkg_vendor object represents a mapping of pkgpart numbers to
29 external package numbers. FS::part_pkg_vendor inherits from FS::Record.
30 The following fields are currently supported:
59 Creates a new example. To add the example to the database, see L<"insert">.
61 Note that this stores the hash reference, not a distinct copy of the hash it
62 points to. You can ask the object for a copy with the I<hash> method.
66 # the new method can be inherited from FS::Record, if a table method is defined
68 sub table { 'part_pkg_vendor'; }
72 Adds this record to the database. If there is an error, returns the error,
73 otherwise returns false.
77 # the insert method can be inherited from FS::Record
81 Delete this record from the database.
85 # the delete method can be inherited from FS::Record
87 =item replace OLD_RECORD
89 Replaces the OLD_RECORD with this one in the database. If there is an error,
90 returns the error, otherwise returns false.
94 # the replace method can be inherited from FS::Record
98 Checks all fields to make sure this is a valid example. If there is
99 an error, returns the error, otherwise returns false. Called by the insert
104 # the check method should currently be supplied - FS::Record contains some
105 # data checking routines
111 $self->ut_numbern('num')
112 || $self->ut_foreign_key('pkgpart', 'part_pkg', 'pkgpart')
113 || $self->ut_foreign_key('exportnum', 'part_export', 'exportnum')
114 || $self->ut_textn('vendor_pkg_id')
116 return $error if $error;
123 Returns the L<FS::part_export> associated with this vendor/external package id.
128 qsearchs( 'part_export', { 'exportnum' => $self->exportnum } );
135 L<FS::part_pkg>, L<FS::Record>, schema.html from the base documentation.