don't generate invoices for COMP customers
[freeside.git] / FS / FS / queue_arg.pm
1 package FS::queue_arg;
2
3 use strict;
4 use vars qw( @ISA );
5 use FS::Record qw( qsearch qsearchs );
6
7 @ISA = qw(FS::Record);
8
9 =head1 NAME
10
11 FS::queue_arg - Object methods for queue_arg records
12
13 =head1 SYNOPSIS
14
15   use FS::queue_arg;
16
17   $record = new FS::queue_arg \%hash;
18   $record = new FS::queue_arg { 'column' => 'value' };
19
20   $error = $record->insert;
21
22   $error = $new_record->replace($old_record);
23
24   $error = $record->delete;
25
26   $error = $record->check;
27
28 =head1 DESCRIPTION
29
30 An FS::queue_arg object represents job argument.  FS::queue_arg inherits from
31 FS::Record.  The following fields are currently supported:
32
33 =over 4
34
35 =item argnum - primary key
36
37 =item jobnum - see L<FS::queue>
38
39 =item arg - argument
40
41 =back
42
43 =head1 METHODS
44
45 =over 4
46
47 =item new HASHREF
48
49 Creates a new argument.  To add the example to the database, see L<"insert">.
50
51 Note that this stores the hash reference, not a distinct copy of the hash it
52 points to.  You can ask the object for a copy with the I<hash> method.
53
54 =cut
55
56 # the new method can be inherited from FS::Record, if a table method is defined
57
58 sub table { 'queue_arg'; }
59
60 =item insert
61
62 Adds this record to the database.  If there is an error, returns the error,
63 otherwise returns false.
64
65 =cut
66
67 # the insert method can be inherited from FS::Record
68
69 =item delete
70
71 Delete this record from the database.
72
73 =cut
74
75 # the delete method can be inherited from FS::Record
76
77 =item replace OLD_RECORD
78
79 Replaces the OLD_RECORD with this one in the database.  If there is an error,
80 returns the error, otherwise returns false.
81
82 =cut
83
84 # the replace method can be inherited from FS::Record
85
86 =item check
87
88 Checks all fields to make sure this is a valid argument.  If there is
89 an error, returns the error, otherwise returns false.  Called by the insert
90 and replace methods.
91
92 =cut
93
94 sub check {
95   my $self = shift;
96   my $error =
97     $self->ut_numbern('argnum')
98     || $self->ut_numbern('jobnum')
99     || $self->ut_anything('arg')
100   ;
101   return $error if $error;
102
103   $self->SUPER::check;
104 }
105
106 =back
107
108 =head1 VERSION
109
110 $Id: queue_arg.pm,v 1.2 2003-08-05 00:20:46 khoff Exp $
111
112 =head1 BUGS
113
114 =head1 SEE ALSO
115
116 L<FS::queue>, L<FS::Record>, schema.html from the base documentation.
117
118 =cut
119
120 1;
121