4 use base qw( FS::Record );
5 use FS::Record qw( qsearchs ); # qsearch qsearchs );
10 FS::vend_main - Object methods for vend_main records
16 $record = new FS::vend_main \%hash;
17 $record = new FS::vend_main { 'column' => 'value' };
19 $error = $record->insert;
21 $error = $new_record->replace($old_record);
23 $error = $record->delete;
25 $error = $record->check;
29 An FS::vend_main object represents a vendor. FS::vend_main inherits from
30 FS::Record. The following fields are currently supported:
59 Creates a new vendor. To add the vendor 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 sub table { 'vend_main'; }
70 Adds this record to the database. If there is an error, returns the error,
71 otherwise returns false.
75 Delete this record from the database.
77 =item replace OLD_RECORD
79 Replaces the OLD_RECORD with this one in the database. If there is an error,
80 returns the error, otherwise returns false.
84 Checks all fields to make sure this is a valid vendor. If there is
85 an error, returns the error, otherwise returns false. Called by the insert
94 $self->ut_numbern('vendnum')
95 || $self->ut_text('vendname')
96 || $self->ut_foreign_key('classnum', 'vend_class', 'classnum')
97 || $self->ut_enum('disabled', [ '', 'Y' ] )
99 return $error if $error;
110 qsearchs('vend_class', { 'classnum' => $self->classnum } );
119 L<FS::Record>, schema.html from the base documentation.