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