This commit was generated by cvs2svn to compensate for changes in r4407,
[freeside.git] / rt / lib / RT / Attachment.pm
1 # BEGIN LICENSE BLOCK
2
3 # Copyright (c) 1996-2003 Jesse Vincent <jesse@bestpractical.com>
4
5 # (Except where explictly superceded by other copyright notices)
6
7 # This work is made available to you under the terms of Version 2 of
8 # the GNU General Public License. A copy of that license should have
9 # been provided with this software, but in any event can be snarfed
10 # from www.gnu.org.
11
12 # This work is distributed in the hope that it will be useful, but
13 # WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15 # General Public License for more details.
16
17 # Unless otherwise specified, all modifications, corrections or
18 # extensions to this work which alter its source code become the
19 # property of Best Practical Solutions, LLC when submitted for
20 # inclusion in the work.
21
22
23 # END LICENSE BLOCK
24 # Autogenerated by DBIx::SearchBuilder factory (by <jesse@bestpractical.com>)
25 # WARNING: THIS FILE IS AUTOGENERATED. ALL CHANGES TO THIS FILE WILL BE LOST.  
26
27 # !! DO NOT EDIT THIS FILE !!
28 #
29
30 use strict;
31
32
33 =head1 NAME
34
35 RT::Attachment
36
37
38 =head1 SYNOPSIS
39
40 =head1 DESCRIPTION
41
42 =head1 METHODS
43
44 =cut
45
46 package RT::Attachment;
47 use RT::Record; 
48
49
50 use vars qw( @ISA );
51 @ISA= qw( RT::Record );
52
53 sub _Init {
54   my $self = shift; 
55
56   $self->Table('Attachments');
57   $self->SUPER::_Init(@_);
58 }
59
60
61
62
63
64 =item Create PARAMHASH
65
66 Create takes a hash of values and creates a row in the database:
67
68   int(11) 'TransactionId'.
69   int(11) 'Parent'.
70   varchar(160) 'MessageId'.
71   varchar(255) 'Subject'.
72   varchar(255) 'Filename'.
73   varchar(80) 'ContentType'.
74   varchar(80) 'ContentEncoding'.
75   longtext 'Content'.
76   longtext 'Headers'.
77
78 =cut
79
80
81
82
83 sub Create {
84     my $self = shift;
85     my %args = ( 
86                 TransactionId => '0',
87                 Parent => '0',
88                 MessageId => '',
89                 Subject => '',
90                 Filename => '',
91                 ContentType => '',
92                 ContentEncoding => '',
93                 Content => '',
94                 Headers => '',
95
96                   @_);
97     $self->SUPER::Create(
98                          TransactionId => $args{'TransactionId'},
99                          Parent => $args{'Parent'},
100                          MessageId => $args{'MessageId'},
101                          Subject => $args{'Subject'},
102                          Filename => $args{'Filename'},
103                          ContentType => $args{'ContentType'},
104                          ContentEncoding => $args{'ContentEncoding'},
105                          Content => $args{'Content'},
106                          Headers => $args{'Headers'},
107 );
108
109 }
110
111
112
113 =item id
114
115 Returns the current value of id. 
116 (In the database, id is stored as int(11).)
117
118
119 =cut
120
121
122 =item TransactionId
123
124 Returns the current value of TransactionId. 
125 (In the database, TransactionId is stored as int(11).)
126
127
128
129 =item SetTransactionId VALUE
130
131
132 Set TransactionId to VALUE. 
133 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
134 (In the database, TransactionId will be stored as a int(11).)
135
136
137 =cut
138
139
140 =item Parent
141
142 Returns the current value of Parent. 
143 (In the database, Parent is stored as int(11).)
144
145
146
147 =item SetParent VALUE
148
149
150 Set Parent to VALUE. 
151 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
152 (In the database, Parent will be stored as a int(11).)
153
154
155 =cut
156
157
158 =item MessageId
159
160 Returns the current value of MessageId. 
161 (In the database, MessageId is stored as varchar(160).)
162
163
164
165 =item SetMessageId VALUE
166
167
168 Set MessageId to VALUE. 
169 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
170 (In the database, MessageId will be stored as a varchar(160).)
171
172
173 =cut
174
175
176 =item Subject
177
178 Returns the current value of Subject. 
179 (In the database, Subject is stored as varchar(255).)
180
181
182
183 =item SetSubject VALUE
184
185
186 Set Subject to VALUE. 
187 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
188 (In the database, Subject will be stored as a varchar(255).)
189
190
191 =cut
192
193
194 =item Filename
195
196 Returns the current value of Filename. 
197 (In the database, Filename is stored as varchar(255).)
198
199
200
201 =item SetFilename VALUE
202
203
204 Set Filename to VALUE. 
205 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
206 (In the database, Filename will be stored as a varchar(255).)
207
208
209 =cut
210
211
212 =item ContentType
213
214 Returns the current value of ContentType. 
215 (In the database, ContentType is stored as varchar(80).)
216
217
218
219 =item SetContentType VALUE
220
221
222 Set ContentType to VALUE. 
223 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
224 (In the database, ContentType will be stored as a varchar(80).)
225
226
227 =cut
228
229
230 =item ContentEncoding
231
232 Returns the current value of ContentEncoding. 
233 (In the database, ContentEncoding is stored as varchar(80).)
234
235
236
237 =item SetContentEncoding VALUE
238
239
240 Set ContentEncoding to VALUE. 
241 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
242 (In the database, ContentEncoding will be stored as a varchar(80).)
243
244
245 =cut
246
247
248 =item Content
249
250 Returns the current value of Content. 
251 (In the database, Content is stored as longtext.)
252
253
254
255 =item SetContent VALUE
256
257
258 Set Content to VALUE. 
259 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
260 (In the database, Content will be stored as a longtext.)
261
262
263 =cut
264
265
266 =item Headers
267
268 Returns the current value of Headers. 
269 (In the database, Headers is stored as longtext.)
270
271
272
273 =item SetHeaders VALUE
274
275
276 Set Headers to VALUE. 
277 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
278 (In the database, Headers will be stored as a longtext.)
279
280
281 =cut
282
283
284 =item Creator
285
286 Returns the current value of Creator. 
287 (In the database, Creator is stored as int(11).)
288
289
290 =cut
291
292
293 =item Created
294
295 Returns the current value of Created. 
296 (In the database, Created is stored as datetime.)
297
298
299 =cut
300
301
302
303 sub _ClassAccessible {
304     {
305      
306         id =>
307                 {read => 1, type => 'int(11)', default => ''},
308         TransactionId => 
309                 {read => 1, write => 1, type => 'int(11)', default => '0'},
310         Parent => 
311                 {read => 1, write => 1, type => 'int(11)', default => '0'},
312         MessageId => 
313                 {read => 1, write => 1, type => 'varchar(160)', default => ''},
314         Subject => 
315                 {read => 1, write => 1, type => 'varchar(255)', default => ''},
316         Filename => 
317                 {read => 1, write => 1, type => 'varchar(255)', default => ''},
318         ContentType => 
319                 {read => 1, write => 1, type => 'varchar(80)', default => ''},
320         ContentEncoding => 
321                 {read => 1, write => 1, type => 'varchar(80)', default => ''},
322         Content => 
323                 {read => 1, write => 1, type => 'longtext', default => ''},
324         Headers => 
325                 {read => 1, write => 1, type => 'longtext', default => ''},
326         Creator => 
327                 {read => 1, auto => 1, type => 'int(11)', default => '0'},
328         Created => 
329                 {read => 1, auto => 1, type => 'datetime', default => ''},
330
331  }
332 };
333
334
335         eval "require RT::Attachment_Overlay";
336         if ($@ && $@ !~ qr{^Can't locate RT/Attachment_Overlay.pm}) {
337             die $@;
338         };
339
340         eval "require RT::Attachment_Vendor";
341         if ($@ && $@ !~ qr{^Can't locate RT/Attachment_Vendor.pm}) {
342             die $@;
343         };
344
345         eval "require RT::Attachment_Local";
346         if ($@ && $@ !~ qr{^Can't locate RT/Attachment_Local.pm}) {
347             die $@;
348         };
349
350
351
352
353 =head1 SEE ALSO
354
355 This class allows "overlay" methods to be placed
356 into the following files _Overlay is for a System overlay by the original author,
357 _Vendor is for 3rd-party vendor add-ons, while _Local is for site-local customizations.  
358
359 These overlay files can contain new subs or subs to replace existing subs in this module.
360
361 If you'll be working with perl 5.6.0 or greater, each of these files should begin with the line 
362
363    no warnings qw(redefine);
364
365 so that perl does not kick and scream when you redefine a subroutine or variable in your overlay.
366
367 RT::Attachment_Overlay, RT::Attachment_Vendor, RT::Attachment_Local
368
369 =cut
370
371
372 1;