reverting to vendor branch rt 3.0.4, hopefully
[freeside.git] / rt / lib / RT / Transaction.pm
1 # BEGIN LICENSE BLOCK
2
3 # Copyright (c) 1996-2003 Jesse Vincent <jesse@bestpractical.com>
4
5 # (Except where explictly superceded by other copyright notices)
6
7 # This work is made available to you under the terms of Version 2 of
8 # the GNU General Public License. A copy of that license should have
9 # been provided with this software, but in any event can be snarfed
10 # from www.gnu.org.
11
12 # This work is distributed in the hope that it will be useful, but
13 # WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15 # General Public License for more details.
16
17 # Unless otherwise specified, all modifications, corrections or
18 # extensions to this work which alter its source code become the
19 # property of Best Practical Solutions, LLC when submitted for
20 # inclusion in the work.
21
22
23 # END LICENSE BLOCK
24 # Autogenerated by DBIx::SearchBuilder factory (by <jesse@bestpractical.com>)
25 # WARNING: THIS FILE IS AUTOGENERATED. ALL CHANGES TO THIS FILE WILL BE LOST.  
26
27 # !! DO NOT EDIT THIS FILE !!
28 #
29
30 use strict;
31
32
33 =head1 NAME
34
35 RT::Transaction
36
37
38 =head1 SYNOPSIS
39
40 =head1 DESCRIPTION
41
42 =head1 METHODS
43
44 =cut
45
46 package RT::Transaction;
47 use RT::Record; 
48 use RT::Ticket;
49
50
51 use vars qw( @ISA );
52 @ISA= qw( RT::Record );
53
54 sub _Init {
55   my $self = shift; 
56
57   $self->Table('Transactions');
58   $self->SUPER::_Init(@_);
59 }
60
61
62
63
64
65 =item Create PARAMHASH
66
67 Create takes a hash of values and creates a row in the database:
68
69   int(11) 'EffectiveTicket'.
70   int(11) 'Ticket'.
71   int(11) 'TimeTaken'.
72   varchar(20) 'Type'.
73   varchar(40) 'Field'.
74   varchar(255) 'OldValue'.
75   varchar(255) 'NewValue'.
76   varchar(100) 'Data'.
77
78 =cut
79
80
81
82
83 sub Create {
84     my $self = shift;
85     my %args = ( 
86                 EffectiveTicket => '0',
87                 Ticket => '0',
88                 TimeTaken => '0',
89                 Type => '',
90                 Field => '',
91                 OldValue => '',
92                 NewValue => '',
93                 Data => '',
94
95                   @_);
96     $self->SUPER::Create(
97                          EffectiveTicket => $args{'EffectiveTicket'},
98                          Ticket => $args{'Ticket'},
99                          TimeTaken => $args{'TimeTaken'},
100                          Type => $args{'Type'},
101                          Field => $args{'Field'},
102                          OldValue => $args{'OldValue'},
103                          NewValue => $args{'NewValue'},
104                          Data => $args{'Data'},
105 );
106
107 }
108
109
110
111 =item id
112
113 Returns the current value of id. 
114 (In the database, id is stored as int(11).)
115
116
117 =cut
118
119
120 =item EffectiveTicket
121
122 Returns the current value of EffectiveTicket. 
123 (In the database, EffectiveTicket is stored as int(11).)
124
125
126
127 =item SetEffectiveTicket VALUE
128
129
130 Set EffectiveTicket to VALUE. 
131 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
132 (In the database, EffectiveTicket will be stored as a int(11).)
133
134
135 =cut
136
137
138 =item Ticket
139
140 Returns the current value of Ticket. 
141 (In the database, Ticket is stored as int(11).)
142
143
144
145 =item SetTicket VALUE
146
147
148 Set Ticket to VALUE. 
149 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
150 (In the database, Ticket will be stored as a int(11).)
151
152
153 =cut
154
155
156 =item TicketObj
157
158 Returns the Ticket Object which has the id returned by Ticket
159
160
161 =cut
162
163 sub TicketObj {
164         my $self = shift;
165         my $Ticket =  RT::Ticket->new($self->CurrentUser);
166         $Ticket->Load($self->__Value('Ticket'));
167         return($Ticket);
168 }
169
170 =item TimeTaken
171
172 Returns the current value of TimeTaken. 
173 (In the database, TimeTaken is stored as int(11).)
174
175
176
177 =item SetTimeTaken VALUE
178
179
180 Set TimeTaken to VALUE. 
181 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
182 (In the database, TimeTaken will be stored as a int(11).)
183
184
185 =cut
186
187
188 =item Type
189
190 Returns the current value of Type. 
191 (In the database, Type is stored as varchar(20).)
192
193
194
195 =item SetType VALUE
196
197
198 Set Type to VALUE. 
199 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
200 (In the database, Type will be stored as a varchar(20).)
201
202
203 =cut
204
205
206 =item Field
207
208 Returns the current value of Field. 
209 (In the database, Field is stored as varchar(40).)
210
211
212
213 =item SetField VALUE
214
215
216 Set Field to VALUE. 
217 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
218 (In the database, Field will be stored as a varchar(40).)
219
220
221 =cut
222
223
224 =item OldValue
225
226 Returns the current value of OldValue. 
227 (In the database, OldValue is stored as varchar(255).)
228
229
230
231 =item SetOldValue VALUE
232
233
234 Set OldValue to VALUE. 
235 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
236 (In the database, OldValue will be stored as a varchar(255).)
237
238
239 =cut
240
241
242 =item NewValue
243
244 Returns the current value of NewValue. 
245 (In the database, NewValue is stored as varchar(255).)
246
247
248
249 =item SetNewValue VALUE
250
251
252 Set NewValue to VALUE. 
253 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
254 (In the database, NewValue will be stored as a varchar(255).)
255
256
257 =cut
258
259
260 =item Data
261
262 Returns the current value of Data. 
263 (In the database, Data is stored as varchar(100).)
264
265
266
267 =item SetData VALUE
268
269
270 Set Data to VALUE. 
271 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
272 (In the database, Data will be stored as a varchar(100).)
273
274
275 =cut
276
277
278 =item Creator
279
280 Returns the current value of Creator. 
281 (In the database, Creator is stored as int(11).)
282
283
284 =cut
285
286
287 =item Created
288
289 Returns the current value of Created. 
290 (In the database, Created is stored as datetime.)
291
292
293 =cut
294
295
296
297 sub _ClassAccessible {
298     {
299      
300         id =>
301                 {read => 1, type => 'int(11)', default => ''},
302         EffectiveTicket => 
303                 {read => 1, write => 1, type => 'int(11)', default => '0'},
304         Ticket => 
305                 {read => 1, write => 1, type => 'int(11)', default => '0'},
306         TimeTaken => 
307                 {read => 1, write => 1, type => 'int(11)', default => '0'},
308         Type => 
309                 {read => 1, write => 1, type => 'varchar(20)', default => ''},
310         Field => 
311                 {read => 1, write => 1, type => 'varchar(40)', default => ''},
312         OldValue => 
313                 {read => 1, write => 1, type => 'varchar(255)', default => ''},
314         NewValue => 
315                 {read => 1, write => 1, type => 'varchar(255)', default => ''},
316         Data => 
317                 {read => 1, write => 1, type => 'varchar(100)', default => ''},
318         Creator => 
319                 {read => 1, auto => 1, type => 'int(11)', default => '0'},
320         Created => 
321                 {read => 1, auto => 1, type => 'datetime', default => ''},
322
323  }
324 };
325
326
327         eval "require RT::Transaction_Overlay";
328         if ($@ && $@ !~ qr{^Can't locate RT/Transaction_Overlay.pm}) {
329             die $@;
330         };
331
332         eval "require RT::Transaction_Vendor";
333         if ($@ && $@ !~ qr{^Can't locate RT/Transaction_Vendor.pm}) {
334             die $@;
335         };
336
337         eval "require RT::Transaction_Local";
338         if ($@ && $@ !~ qr{^Can't locate RT/Transaction_Local.pm}) {
339             die $@;
340         };
341
342
343
344
345 =head1 SEE ALSO
346
347 This class allows "overlay" methods to be placed
348 into the following files _Overlay is for a System overlay by the original author,
349 _Vendor is for 3rd-party vendor add-ons, while _Local is for site-local customizations.  
350
351 These overlay files can contain new subs or subs to replace existing subs in this module.
352
353 If you'll be working with perl 5.6.0 or greater, each of these files should begin with the line 
354
355    no warnings qw(redefine);
356
357 so that perl does not kick and scream when you redefine a subroutine or variable in your overlay.
358
359 RT::Transaction_Overlay, RT::Transaction_Vendor, RT::Transaction_Local
360
361 =cut
362
363
364 1;