import rt 3.2.2
[freeside.git] / rt / lib / RT / Transaction.pm
1 # {{{ BEGIN BPS TAGGED BLOCK
2
3 # COPYRIGHT:
4 #  
5 # This software is Copyright (c) 1996-2004 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 use RT::Ticket;
71
72
73 use vars qw( @ISA );
74 @ISA= qw( RT::Record );
75
76 sub _Init {
77   my $self = shift; 
78
79   $self->Table('Transactions');
80   $self->SUPER::_Init(@_);
81 }
82
83
84
85
86
87 =head2 Create PARAMHASH
88
89 Create takes a hash of values and creates a row in the database:
90
91   int(11) 'EffectiveTicket'.
92   int(11) 'Ticket'.
93   int(11) 'TimeTaken'.
94   varchar(20) 'Type'.
95   varchar(40) 'Field'.
96   varchar(255) 'OldValue'.
97   varchar(255) 'NewValue'.
98   varchar(255) 'Data'.
99
100 =cut
101
102
103
104
105 sub Create {
106     my $self = shift;
107     my %args = ( 
108                 EffectiveTicket => '0',
109                 Ticket => '0',
110                 TimeTaken => '0',
111                 Type => '',
112                 Field => '',
113                 OldValue => '',
114                 NewValue => '',
115                 Data => '',
116
117                   @_);
118     $self->SUPER::Create(
119                          EffectiveTicket => $args{'EffectiveTicket'},
120                          Ticket => $args{'Ticket'},
121                          TimeTaken => $args{'TimeTaken'},
122                          Type => $args{'Type'},
123                          Field => $args{'Field'},
124                          OldValue => $args{'OldValue'},
125                          NewValue => $args{'NewValue'},
126                          Data => $args{'Data'},
127 );
128
129 }
130
131
132
133 =head2 id
134
135 Returns the current value of id. 
136 (In the database, id is stored as int(11).)
137
138
139 =cut
140
141
142 =head2 EffectiveTicket
143
144 Returns the current value of EffectiveTicket. 
145 (In the database, EffectiveTicket is stored as int(11).)
146
147
148
149 =head2 SetEffectiveTicket VALUE
150
151
152 Set EffectiveTicket to VALUE. 
153 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
154 (In the database, EffectiveTicket will be stored as a int(11).)
155
156
157 =cut
158
159
160 =head2 Ticket
161
162 Returns the current value of Ticket. 
163 (In the database, Ticket is stored as int(11).)
164
165
166
167 =head2 SetTicket VALUE
168
169
170 Set Ticket to VALUE. 
171 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
172 (In the database, Ticket will be stored as a int(11).)
173
174
175 =cut
176
177
178 =head2 TicketObj
179
180 Returns the Ticket Object which has the id returned by Ticket
181
182
183 =cut
184
185 sub TicketObj {
186         my $self = shift;
187         my $Ticket =  RT::Ticket->new($self->CurrentUser);
188         $Ticket->Load($self->__Value('Ticket'));
189         return($Ticket);
190 }
191
192 =head2 TimeTaken
193
194 Returns the current value of TimeTaken. 
195 (In the database, TimeTaken is stored as int(11).)
196
197
198
199 =head2 SetTimeTaken VALUE
200
201
202 Set TimeTaken to VALUE. 
203 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
204 (In the database, TimeTaken will be stored as a int(11).)
205
206
207 =cut
208
209
210 =head2 Type
211
212 Returns the current value of Type. 
213 (In the database, Type is stored as varchar(20).)
214
215
216
217 =head2 SetType VALUE
218
219
220 Set Type to VALUE. 
221 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
222 (In the database, Type will be stored as a varchar(20).)
223
224
225 =cut
226
227
228 =head2 Field
229
230 Returns the current value of Field. 
231 (In the database, Field is stored as varchar(40).)
232
233
234
235 =head2 SetField VALUE
236
237
238 Set Field to VALUE. 
239 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
240 (In the database, Field will be stored as a varchar(40).)
241
242
243 =cut
244
245
246 =head2 OldValue
247
248 Returns the current value of OldValue. 
249 (In the database, OldValue is stored as varchar(255).)
250
251
252
253 =head2 SetOldValue VALUE
254
255
256 Set OldValue to VALUE. 
257 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
258 (In the database, OldValue will be stored as a varchar(255).)
259
260
261 =cut
262
263
264 =head2 NewValue
265
266 Returns the current value of NewValue. 
267 (In the database, NewValue is stored as varchar(255).)
268
269
270
271 =head2 SetNewValue VALUE
272
273
274 Set NewValue to VALUE. 
275 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
276 (In the database, NewValue will be stored as a varchar(255).)
277
278
279 =cut
280
281
282 =head2 Data
283
284 Returns the current value of Data. 
285 (In the database, Data is stored as varchar(255).)
286
287
288
289 =head2 SetData VALUE
290
291
292 Set Data to VALUE. 
293 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
294 (In the database, Data will be stored as a varchar(255).)
295
296
297 =cut
298
299
300 =head2 Creator
301
302 Returns the current value of Creator. 
303 (In the database, Creator is stored as int(11).)
304
305
306 =cut
307
308
309 =head2 Created
310
311 Returns the current value of Created. 
312 (In the database, Created is stored as datetime.)
313
314
315 =cut
316
317
318
319 sub _CoreAccessible {
320     {
321      
322         id =>
323                 {read => 1, type => 'int(11)', default => ''},
324         EffectiveTicket => 
325                 {read => 1, write => 1, type => 'int(11)', default => '0'},
326         Ticket => 
327                 {read => 1, write => 1, type => 'int(11)', default => '0'},
328         TimeTaken => 
329                 {read => 1, write => 1, type => 'int(11)', default => '0'},
330         Type => 
331                 {read => 1, write => 1, type => 'varchar(20)', default => ''},
332         Field => 
333                 {read => 1, write => 1, type => 'varchar(40)', default => ''},
334         OldValue => 
335                 {read => 1, write => 1, type => 'varchar(255)', default => ''},
336         NewValue => 
337                 {read => 1, write => 1, type => 'varchar(255)', default => ''},
338         Data => 
339                 {read => 1, write => 1, type => 'varchar(255)', default => ''},
340         Creator => 
341                 {read => 1, auto => 1, type => 'int(11)', default => '0'},
342         Created => 
343                 {read => 1, auto => 1, type => 'datetime', default => ''},
344
345  }
346 };
347
348
349         eval "require RT::Transaction_Overlay";
350         if ($@ && $@ !~ qr{^Can't locate RT/Transaction_Overlay.pm}) {
351             die $@;
352         };
353
354         eval "require RT::Transaction_Vendor";
355         if ($@ && $@ !~ qr{^Can't locate RT/Transaction_Vendor.pm}) {
356             die $@;
357         };
358
359         eval "require RT::Transaction_Local";
360         if ($@ && $@ !~ qr{^Can't locate RT/Transaction_Local.pm}) {
361             die $@;
362         };
363
364
365
366
367 =head1 SEE ALSO
368
369 This class allows "overlay" methods to be placed
370 into the following files _Overlay is for a System overlay by the original author,
371 _Vendor is for 3rd-party vendor add-ons, while _Local is for site-local customizations.  
372
373 These overlay files can contain new subs or subs to replace existing subs in this module.
374
375 If you'll be working with perl 5.6.0 or greater, each of these files should begin with the line 
376
377    no warnings qw(redefine);
378
379 so that perl does not kick and scream when you redefine a subroutine or variable in your overlay.
380
381 RT::Transaction_Overlay, RT::Transaction_Vendor, RT::Transaction_Local
382
383 =cut
384
385
386 1;