import rt 3.4.6
[freeside.git] / rt / lib / RT / Attachment.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::Attachment
58
59
60 =head1 SYNOPSIS
61
62 =head1 DESCRIPTION
63
64 =head1 METHODS
65
66 =cut
67
68 package RT::Attachment;
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('Attachments');
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   int(11) 'TransactionId'.
91   int(11) 'Parent'.
92   varchar(160) 'MessageId'.
93   varchar(255) 'Subject'.
94   varchar(255) 'Filename'.
95   varchar(80) 'ContentType'.
96   varchar(80) 'ContentEncoding'.
97   longtext 'Content'.
98   longtext 'Headers'.
99
100 =cut
101
102
103
104
105 sub Create {
106     my $self = shift;
107     my %args = ( 
108                 TransactionId => '0',
109                 Parent => '0',
110                 MessageId => '',
111                 Subject => '',
112                 Filename => '',
113                 ContentType => '',
114                 ContentEncoding => '',
115                 Content => '',
116                 Headers => '',
117
118                   @_);
119     $self->SUPER::Create(
120                          TransactionId => $args{'TransactionId'},
121                          Parent => $args{'Parent'},
122                          MessageId => $args{'MessageId'},
123                          Subject => $args{'Subject'},
124                          Filename => $args{'Filename'},
125                          ContentType => $args{'ContentType'},
126                          ContentEncoding => $args{'ContentEncoding'},
127                          Content => $args{'Content'},
128                          Headers => $args{'Headers'},
129 );
130
131 }
132
133
134
135 =head2 id
136
137 Returns the current value of id. 
138 (In the database, id is stored as int(11).)
139
140
141 =cut
142
143
144 =head2 TransactionId
145
146 Returns the current value of TransactionId. 
147 (In the database, TransactionId is stored as int(11).)
148
149
150
151 =head2 SetTransactionId VALUE
152
153
154 Set TransactionId to VALUE. 
155 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
156 (In the database, TransactionId will be stored as a int(11).)
157
158
159 =cut
160
161
162 =head2 Parent
163
164 Returns the current value of Parent. 
165 (In the database, Parent is stored as int(11).)
166
167
168
169 =head2 SetParent VALUE
170
171
172 Set Parent to VALUE. 
173 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
174 (In the database, Parent will be stored as a int(11).)
175
176
177 =cut
178
179
180 =head2 MessageId
181
182 Returns the current value of MessageId. 
183 (In the database, MessageId is stored as varchar(160).)
184
185
186
187 =head2 SetMessageId VALUE
188
189
190 Set MessageId to VALUE. 
191 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
192 (In the database, MessageId will be stored as a varchar(160).)
193
194
195 =cut
196
197
198 =head2 Subject
199
200 Returns the current value of Subject. 
201 (In the database, Subject is stored as varchar(255).)
202
203
204
205 =head2 SetSubject VALUE
206
207
208 Set Subject to VALUE. 
209 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
210 (In the database, Subject will be stored as a varchar(255).)
211
212
213 =cut
214
215
216 =head2 Filename
217
218 Returns the current value of Filename. 
219 (In the database, Filename is stored as varchar(255).)
220
221
222
223 =head2 SetFilename VALUE
224
225
226 Set Filename to VALUE. 
227 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
228 (In the database, Filename will be stored as a varchar(255).)
229
230
231 =cut
232
233
234 =head2 ContentType
235
236 Returns the current value of ContentType. 
237 (In the database, ContentType is stored as varchar(80).)
238
239
240
241 =head2 SetContentType VALUE
242
243
244 Set ContentType to VALUE. 
245 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
246 (In the database, ContentType will be stored as a varchar(80).)
247
248
249 =cut
250
251
252 =head2 ContentEncoding
253
254 Returns the current value of ContentEncoding. 
255 (In the database, ContentEncoding is stored as varchar(80).)
256
257
258
259 =head2 SetContentEncoding VALUE
260
261
262 Set ContentEncoding to VALUE. 
263 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
264 (In the database, ContentEncoding will be stored as a varchar(80).)
265
266
267 =cut
268
269
270 =head2 Content
271
272 Returns the current value of Content. 
273 (In the database, Content is stored as longtext.)
274
275
276
277 =head2 SetContent VALUE
278
279
280 Set Content to VALUE. 
281 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
282 (In the database, Content will be stored as a longtext.)
283
284
285 =cut
286
287
288 =head2 Headers
289
290 Returns the current value of Headers. 
291 (In the database, Headers is stored as longtext.)
292
293
294
295 =head2 SetHeaders VALUE
296
297
298 Set Headers to VALUE. 
299 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
300 (In the database, Headers will be stored as a longtext.)
301
302
303 =cut
304
305
306 =head2 Creator
307
308 Returns the current value of Creator. 
309 (In the database, Creator is stored as int(11).)
310
311
312 =cut
313
314
315 =head2 Created
316
317 Returns the current value of Created. 
318 (In the database, Created is stored as datetime.)
319
320
321 =cut
322
323
324
325 sub _CoreAccessible {
326     {
327      
328         id =>
329                 {read => 1, sql_type => 4, length => 11,  is_blob => 0,  is_numeric => 1,  type => 'int(11)', default => ''},
330         TransactionId => 
331                 {read => 1, write => 1, sql_type => 4, length => 11,  is_blob => 0,  is_numeric => 1,  type => 'int(11)', default => '0'},
332         Parent => 
333                 {read => 1, write => 1, sql_type => 4, length => 11,  is_blob => 0,  is_numeric => 1,  type => 'int(11)', default => '0'},
334         MessageId => 
335                 {read => 1, write => 1, sql_type => 12, length => 160,  is_blob => 0,  is_numeric => 0,  type => 'varchar(160)', default => ''},
336         Subject => 
337                 {read => 1, write => 1, sql_type => 12, length => 255,  is_blob => 0,  is_numeric => 0,  type => 'varchar(255)', default => ''},
338         Filename => 
339                 {read => 1, write => 1, sql_type => 12, length => 255,  is_blob => 0,  is_numeric => 0,  type => 'varchar(255)', default => ''},
340         ContentType => 
341                 {read => 1, write => 1, sql_type => 12, length => 80,  is_blob => 0,  is_numeric => 0,  type => 'varchar(80)', default => ''},
342         ContentEncoding => 
343                 {read => 1, write => 1, sql_type => 12, length => 80,  is_blob => 0,  is_numeric => 0,  type => 'varchar(80)', default => ''},
344         Content => 
345                 {read => 1, write => 1, sql_type => -4, length => 0,  is_blob => 1,  is_numeric => 0,  type => 'longtext', default => ''},
346         Headers => 
347                 {read => 1, write => 1, sql_type => -4, length => 0,  is_blob => 1,  is_numeric => 0,  type => 'longtext', default => ''},
348         Creator => 
349                 {read => 1, auto => 1, sql_type => 4, length => 11,  is_blob => 0,  is_numeric => 1,  type => 'int(11)', default => '0'},
350         Created => 
351                 {read => 1, auto => 1, sql_type => 11, length => 0,  is_blob => 0,  is_numeric => 0,  type => 'datetime', default => ''},
352
353  }
354 };
355
356
357         eval "require RT::Attachment_Overlay";
358         if ($@ && $@ !~ qr{^Can't locate RT/Attachment_Overlay.pm}) {
359             die $@;
360         };
361
362         eval "require RT::Attachment_Vendor";
363         if ($@ && $@ !~ qr{^Can't locate RT/Attachment_Vendor.pm}) {
364             die $@;
365         };
366
367         eval "require RT::Attachment_Local";
368         if ($@ && $@ !~ qr{^Can't locate RT/Attachment_Local.pm}) {
369             die $@;
370         };
371
372
373
374
375 =head1 SEE ALSO
376
377 This class allows "overlay" methods to be placed
378 into the following files _Overlay is for a System overlay by the original author,
379 _Vendor is for 3rd-party vendor add-ons, while _Local is for site-local customizations.  
380
381 These overlay files can contain new subs or subs to replace existing subs in this module.
382
383 Each of these files should begin with the line 
384
385    no warnings qw(redefine);
386
387 so that perl does not kick and scream when you redefine a subroutine or variable in your overlay.
388
389 RT::Attachment_Overlay, RT::Attachment_Vendor, RT::Attachment_Local
390
391 =cut
392
393
394 1;