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