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