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