3 # Copyright (c) 1996-2003 Jesse Vincent <jesse@bestpractical.com>
5 # (Except where explictly superceded by other copyright notices)
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
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.
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.
24 # Autogenerated by DBIx::SearchBuilder factory (by <jesse@bestpractical.com>)
25 # WARNING: THIS FILE IS AUTOGENERATED. ALL CHANGES TO THIS FILE WILL BE LOST.
27 # !! DO NOT EDIT THIS FILE !!
46 package RT::Attachment;
51 @ISA= qw( RT::Record );
56 $self->Table('Attachments');
57 $self->SUPER::_Init(@_);
64 =item Create PARAMHASH
66 Create takes a hash of values and creates a row in the database:
68 int(11) 'TransactionId'.
70 varchar(160) 'MessageId'.
71 varchar(255) 'Subject'.
72 varchar(255) 'Filename'.
73 varchar(80) 'ContentType'.
74 varchar(80) 'ContentEncoding'.
92 ContentEncoding => '',
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'},
115 Returns the current value of id.
116 (In the database, id is stored as int(11).)
124 Returns the current value of TransactionId.
125 (In the database, TransactionId is stored as int(11).)
129 =item SetTransactionId VALUE
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).)
142 Returns the current value of Parent.
143 (In the database, Parent is stored as int(11).)
147 =item SetParent 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).)
160 Returns the current value of MessageId.
161 (In the database, MessageId is stored as varchar(160).)
165 =item SetMessageId VALUE
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).)
178 Returns the current value of Subject.
179 (In the database, Subject is stored as varchar(255).)
183 =item SetSubject VALUE
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).)
196 Returns the current value of Filename.
197 (In the database, Filename is stored as varchar(255).)
201 =item SetFilename VALUE
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).)
214 Returns the current value of ContentType.
215 (In the database, ContentType is stored as varchar(80).)
219 =item SetContentType VALUE
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).)
230 =item ContentEncoding
232 Returns the current value of ContentEncoding.
233 (In the database, ContentEncoding is stored as varchar(80).)
237 =item SetContentEncoding VALUE
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).)
250 Returns the current value of Content.
251 (In the database, Content is stored as longtext.)
255 =item SetContent VALUE
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.)
268 Returns the current value of Headers.
269 (In the database, Headers is stored as longtext.)
273 =item SetHeaders VALUE
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.)
286 Returns the current value of Creator.
287 (In the database, Creator is stored as int(11).)
295 Returns the current value of Created.
296 (In the database, Created is stored as datetime.)
303 sub _ClassAccessible {
307 {read => 1, type => 'int(11)', default => ''},
309 {read => 1, write => 1, type => 'int(11)', default => '0'},
311 {read => 1, write => 1, type => 'int(11)', default => '0'},
313 {read => 1, write => 1, type => 'varchar(160)', default => ''},
315 {read => 1, write => 1, type => 'varchar(255)', default => ''},
317 {read => 1, write => 1, type => 'varchar(255)', default => ''},
319 {read => 1, write => 1, type => 'varchar(80)', default => ''},
321 {read => 1, write => 1, type => 'varchar(80)', default => ''},
323 {read => 1, write => 1, type => 'longtext', default => ''},
325 {read => 1, write => 1, type => 'longtext', default => ''},
327 {read => 1, auto => 1, type => 'int(11)', default => '0'},
329 {read => 1, auto => 1, type => 'datetime', default => ''},
335 eval "require RT::Attachment_Overlay";
336 if ($@ && $@ !~ qr{^Can't locate RT/Attachment_Overlay.pm}) {
340 eval "require RT::Attachment_Vendor";
341 if ($@ && $@ !~ qr{^Can't locate RT/Attachment_Vendor.pm}) {
345 eval "require RT::Attachment_Local";
346 if ($@ && $@ !~ qr{^Can't locate RT/Attachment_Local.pm}) {
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.
359 These overlay files can contain new subs or subs to replace existing subs in this module.
361 If you'll be working with perl 5.6.0 or greater, each of these files should begin with the line
363 no warnings qw(redefine);
365 so that perl does not kick and scream when you redefine a subroutine or variable in your overlay.
367 RT::Attachment_Overlay, RT::Attachment_Vendor, RT::Attachment_Local