import rt 3.4.4
[freeside.git] / rt / lib / RT / Transaction.pm
1 # BEGIN BPS TAGGED BLOCK {{{
2
3 # COPYRIGHT:
4 #  
5 # This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC 
6 #                                          <jesse@bestpractical.com>
7
8 # (Except where explicitly superseded by other copyright notices)
9
10
11 # LICENSE:
12
13 # This work is made available to you under the terms of Version 2 of
14 # the GNU General Public License. A copy of that license should have
15 # been provided with this software, but in any event can be snarfed
16 # from www.gnu.org.
17
18 # This work is distributed in the hope that it will be useful, but
19 # WITHOUT ANY WARRANTY; without even the implied warranty of
20 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
21 # General Public License for more details.
22
23 # You should have received a copy of the GNU General Public License
24 # along with this program; if not, write to the Free Software
25 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
26
27
28 # CONTRIBUTION SUBMISSION POLICY:
29
30 # (The following paragraph is not intended to limit the rights granted
31 # to you to modify and distribute this software under the terms of
32 # the GNU General Public License and is only of importance to you if
33 # you choose to contribute your changes and enhancements to the
34 # community by submitting them to Best Practical Solutions, LLC.)
35
36 # By intentionally submitting any modifications, corrections or
37 # derivatives to this work, or any other work intended for use with
38 # Request Tracker, to Best Practical Solutions, LLC, you confirm that
39 # you are the copyright holder for those contributions and you grant
40 # Best Practical Solutions,  LLC a nonexclusive, worldwide, irrevocable,
41 # royalty-free, perpetual, license to use, copy, create derivative
42 # works based on those contributions, and sublicense and distribute
43 # those contributions and any derivatives thereof.
44
45 # END BPS TAGGED BLOCK }}}
46 # Autogenerated by DBIx::SearchBuilder factory (by <jesse@bestpractical.com>)
47 # WARNING: THIS FILE IS AUTOGENERATED. ALL CHANGES TO THIS FILE WILL BE LOST.  
48
49 # !! DO NOT EDIT THIS FILE !!
50 #
51
52 use strict;
53
54
55 =head1 NAME
56
57 RT::Transaction
58
59
60 =head1 SYNOPSIS
61
62 =head1 DESCRIPTION
63
64 =head1 METHODS
65
66 =cut
67
68 package RT::Transaction;
69 use RT::Record; 
70
71
72 use vars qw( @ISA );
73 @ISA= qw( RT::Record );
74
75 sub _Init {
76   my $self = shift; 
77
78   $self->Table('Transactions');
79   $self->SUPER::_Init(@_);
80 }
81
82
83
84
85
86 =head2 Create PARAMHASH
87
88 Create takes a hash of values and creates a row in the database:
89
90   varchar(64) 'ObjectType'.
91   int(11) 'ObjectId'.
92   int(11) 'TimeTaken'.
93   varchar(20) 'Type'.
94   varchar(40) 'Field'.
95   varchar(255) 'OldValue'.
96   varchar(255) 'NewValue'.
97   varchar(255) 'ReferenceType'.
98   int(11) 'OldReference'.
99   int(11) 'NewReference'.
100   varchar(255) 'Data'.
101
102 =cut
103
104
105
106
107 sub Create {
108     my $self = shift;
109     my %args = ( 
110                 ObjectType => '',
111                 ObjectId => '0',
112                 TimeTaken => '0',
113                 Type => '',
114                 Field => '',
115                 OldValue => '',
116                 NewValue => '',
117                 ReferenceType => '',
118                 OldReference => '',
119                 NewReference => '',
120                 Data => '',
121
122                   @_);
123     $self->SUPER::Create(
124                          ObjectType => $args{'ObjectType'},
125                          ObjectId => $args{'ObjectId'},
126                          TimeTaken => $args{'TimeTaken'},
127                          Type => $args{'Type'},
128                          Field => $args{'Field'},
129                          OldValue => $args{'OldValue'},
130                          NewValue => $args{'NewValue'},
131                          ReferenceType => $args{'ReferenceType'},
132                          OldReference => $args{'OldReference'},
133                          NewReference => $args{'NewReference'},
134                          Data => $args{'Data'},
135 );
136
137 }
138
139
140
141 =head2 id
142
143 Returns the current value of id. 
144 (In the database, id is stored as int(11).)
145
146
147 =cut
148
149
150 =head2 ObjectType
151
152 Returns the current value of ObjectType. 
153 (In the database, ObjectType is stored as varchar(64).)
154
155
156
157 =head2 SetObjectType VALUE
158
159
160 Set ObjectType to VALUE. 
161 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
162 (In the database, ObjectType will be stored as a varchar(64).)
163
164
165 =cut
166
167
168 =head2 ObjectId
169
170 Returns the current value of ObjectId. 
171 (In the database, ObjectId is stored as int(11).)
172
173
174
175 =head2 SetObjectId VALUE
176
177
178 Set ObjectId to VALUE. 
179 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
180 (In the database, ObjectId will be stored as a int(11).)
181
182
183 =cut
184
185
186 =head2 TimeTaken
187
188 Returns the current value of TimeTaken. 
189 (In the database, TimeTaken is stored as int(11).)
190
191
192
193 =head2 SetTimeTaken VALUE
194
195
196 Set TimeTaken to VALUE. 
197 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
198 (In the database, TimeTaken will be stored as a int(11).)
199
200
201 =cut
202
203
204 =head2 Type
205
206 Returns the current value of Type. 
207 (In the database, Type is stored as varchar(20).)
208
209
210
211 =head2 SetType VALUE
212
213
214 Set Type to VALUE. 
215 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
216 (In the database, Type will be stored as a varchar(20).)
217
218
219 =cut
220
221
222 =head2 Field
223
224 Returns the current value of Field. 
225 (In the database, Field is stored as varchar(40).)
226
227
228
229 =head2 SetField VALUE
230
231
232 Set Field to VALUE. 
233 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
234 (In the database, Field will be stored as a varchar(40).)
235
236
237 =cut
238
239
240 =head2 OldValue
241
242 Returns the current value of OldValue. 
243 (In the database, OldValue is stored as varchar(255).)
244
245
246
247 =head2 SetOldValue VALUE
248
249
250 Set OldValue to VALUE. 
251 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
252 (In the database, OldValue will be stored as a varchar(255).)
253
254
255 =cut
256
257
258 =head2 NewValue
259
260 Returns the current value of NewValue. 
261 (In the database, NewValue is stored as varchar(255).)
262
263
264
265 =head2 SetNewValue VALUE
266
267
268 Set NewValue to VALUE. 
269 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
270 (In the database, NewValue will be stored as a varchar(255).)
271
272
273 =cut
274
275
276 =head2 ReferenceType
277
278 Returns the current value of ReferenceType. 
279 (In the database, ReferenceType is stored as varchar(255).)
280
281
282
283 =head2 SetReferenceType VALUE
284
285
286 Set ReferenceType to VALUE. 
287 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
288 (In the database, ReferenceType will be stored as a varchar(255).)
289
290
291 =cut
292
293
294 =head2 OldReference
295
296 Returns the current value of OldReference. 
297 (In the database, OldReference is stored as int(11).)
298
299
300
301 =head2 SetOldReference VALUE
302
303
304 Set OldReference to VALUE. 
305 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
306 (In the database, OldReference will be stored as a int(11).)
307
308
309 =cut
310
311
312 =head2 NewReference
313
314 Returns the current value of NewReference. 
315 (In the database, NewReference is stored as int(11).)
316
317
318
319 =head2 SetNewReference VALUE
320
321
322 Set NewReference to VALUE. 
323 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
324 (In the database, NewReference will be stored as a int(11).)
325
326
327 =cut
328
329
330 =head2 Data
331
332 Returns the current value of Data. 
333 (In the database, Data is stored as varchar(255).)
334
335
336
337 =head2 SetData VALUE
338
339
340 Set Data to VALUE. 
341 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
342 (In the database, Data will be stored as a varchar(255).)
343
344
345 =cut
346
347
348 =head2 Creator
349
350 Returns the current value of Creator. 
351 (In the database, Creator is stored as int(11).)
352
353
354 =cut
355
356
357 =head2 Created
358
359 Returns the current value of Created. 
360 (In the database, Created is stored as datetime.)
361
362
363 =cut
364
365
366
367 sub _CoreAccessible {
368     {
369      
370         id =>
371                 {read => 1, sql_type => 4, length => 11,  is_blob => 0,  is_numeric => 1,  type => 'int(11)', default => ''},
372         ObjectType => 
373                 {read => 1, write => 1, sql_type => 12, length => 64,  is_blob => 0,  is_numeric => 0,  type => 'varchar(64)', default => ''},
374         ObjectId => 
375                 {read => 1, write => 1, sql_type => 4, length => 11,  is_blob => 0,  is_numeric => 1,  type => 'int(11)', default => '0'},
376         TimeTaken => 
377                 {read => 1, write => 1, sql_type => 4, length => 11,  is_blob => 0,  is_numeric => 1,  type => 'int(11)', default => '0'},
378         Type => 
379                 {read => 1, write => 1, sql_type => 12, length => 20,  is_blob => 0,  is_numeric => 0,  type => 'varchar(20)', default => ''},
380         Field => 
381                 {read => 1, write => 1, sql_type => 12, length => 40,  is_blob => 0,  is_numeric => 0,  type => 'varchar(40)', default => ''},
382         OldValue => 
383                 {read => 1, write => 1, sql_type => 12, length => 255,  is_blob => 0,  is_numeric => 0,  type => 'varchar(255)', default => ''},
384         NewValue => 
385                 {read => 1, write => 1, sql_type => 12, length => 255,  is_blob => 0,  is_numeric => 0,  type => 'varchar(255)', default => ''},
386         ReferenceType => 
387                 {read => 1, write => 1, sql_type => 12, length => 255,  is_blob => 0,  is_numeric => 0,  type => 'varchar(255)', default => ''},
388         OldReference => 
389                 {read => 1, write => 1, sql_type => 4, length => 11,  is_blob => 0,  is_numeric => 1,  type => 'int(11)', default => ''},
390         NewReference => 
391                 {read => 1, write => 1, sql_type => 4, length => 11,  is_blob => 0,  is_numeric => 1,  type => 'int(11)', default => ''},
392         Data => 
393                 {read => 1, write => 1, sql_type => 12, length => 255,  is_blob => 0,  is_numeric => 0,  type => 'varchar(255)', default => ''},
394         Creator => 
395                 {read => 1, auto => 1, sql_type => 4, length => 11,  is_blob => 0,  is_numeric => 1,  type => 'int(11)', default => '0'},
396         Created => 
397                 {read => 1, auto => 1, sql_type => 11, length => 0,  is_blob => 0,  is_numeric => 0,  type => 'datetime', default => ''},
398
399  }
400 };
401
402
403         eval "require RT::Transaction_Overlay";
404         if ($@ && $@ !~ qr{^Can't locate RT/Transaction_Overlay.pm}) {
405             die $@;
406         };
407
408         eval "require RT::Transaction_Vendor";
409         if ($@ && $@ !~ qr{^Can't locate RT/Transaction_Vendor.pm}) {
410             die $@;
411         };
412
413         eval "require RT::Transaction_Local";
414         if ($@ && $@ !~ qr{^Can't locate RT/Transaction_Local.pm}) {
415             die $@;
416         };
417
418
419
420
421 =head1 SEE ALSO
422
423 This class allows "overlay" methods to be placed
424 into the following files _Overlay is for a System overlay by the original author,
425 _Vendor is for 3rd-party vendor add-ons, while _Local is for site-local customizations.  
426
427 These overlay files can contain new subs or subs to replace existing subs in this module.
428
429 Each of these files should begin with the line 
430
431    no warnings qw(redefine);
432
433 so that perl does not kick and scream when you redefine a subroutine or variable in your overlay.
434
435 RT::Transaction_Overlay, RT::Transaction_Vendor, RT::Transaction_Local
436
437 =cut
438
439
440 1;