1 # {{{ BEGIN BPS TAGGED BLOCK
5 # This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC
6 # <jesse@bestpractical.com>
8 # (Except where explicitly superseded by other copyright notices)
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
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.
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.
28 # CONTRIBUTION SUBMISSION POLICY:
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.)
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.
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.
49 # !! DO NOT EDIT THIS FILE !!
68 package RT::Attachment;
73 @ISA= qw( RT::Record );
78 $self->Table('Attachments');
79 $self->SUPER::_Init(@_);
86 =head2 Create PARAMHASH
88 Create takes a hash of values and creates a row in the database:
90 int(11) 'TransactionId'.
92 varchar(160) 'MessageId'.
93 varchar(255) 'Subject'.
94 varchar(255) 'Filename'.
95 varchar(80) 'ContentType'.
96 varchar(80) 'ContentEncoding'.
108 TransactionId => '0',
114 ContentEncoding => '',
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'},
137 Returns the current value of id.
138 (In the database, id is stored as int(11).)
146 Returns the current value of TransactionId.
147 (In the database, TransactionId is stored as int(11).)
151 =head2 SetTransactionId VALUE
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).)
164 Returns the current value of Parent.
165 (In the database, Parent is stored as int(11).)
169 =head2 SetParent 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).)
182 Returns the current value of MessageId.
183 (In the database, MessageId is stored as varchar(160).)
187 =head2 SetMessageId VALUE
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).)
200 Returns the current value of Subject.
201 (In the database, Subject is stored as varchar(255).)
205 =head2 SetSubject VALUE
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).)
218 Returns the current value of Filename.
219 (In the database, Filename is stored as varchar(255).)
223 =head2 SetFilename VALUE
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).)
236 Returns the current value of ContentType.
237 (In the database, ContentType is stored as varchar(80).)
241 =head2 SetContentType VALUE
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).)
252 =head2 ContentEncoding
254 Returns the current value of ContentEncoding.
255 (In the database, ContentEncoding is stored as varchar(80).)
259 =head2 SetContentEncoding VALUE
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).)
272 Returns the current value of Content.
273 (In the database, Content is stored as longtext.)
277 =head2 SetContent VALUE
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.)
290 Returns the current value of Headers.
291 (In the database, Headers is stored as longtext.)
295 =head2 SetHeaders VALUE
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.)
308 Returns the current value of Creator.
309 (In the database, Creator is stored as int(11).)
317 Returns the current value of Created.
318 (In the database, Created is stored as datetime.)
325 sub _CoreAccessible {
329 {read => 1, type => 'int(11)', default => ''},
331 {read => 1, write => 1, type => 'int(11)', default => '0'},
333 {read => 1, write => 1, type => 'int(11)', default => '0'},
335 {read => 1, write => 1, type => 'varchar(160)', default => ''},
337 {read => 1, write => 1, type => 'varchar(255)', default => ''},
339 {read => 1, write => 1, type => 'varchar(255)', default => ''},
341 {read => 1, write => 1, type => 'varchar(80)', default => ''},
343 {read => 1, write => 1, type => 'varchar(80)', default => ''},
345 {read => 1, write => 1, type => 'longtext', default => ''},
347 {read => 1, write => 1, type => 'longtext', default => ''},
349 {read => 1, auto => 1, type => 'int(11)', default => '0'},
351 {read => 1, auto => 1, type => 'datetime', default => ''},
357 eval "require RT::Attachment_Overlay";
358 if ($@ && $@ !~ qr{^Can't locate RT/Attachment_Overlay.pm}) {
362 eval "require RT::Attachment_Vendor";
363 if ($@ && $@ !~ qr{^Can't locate RT/Attachment_Vendor.pm}) {
367 eval "require RT::Attachment_Local";
368 if ($@ && $@ !~ qr{^Can't locate RT/Attachment_Local.pm}) {
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.
381 These overlay files can contain new subs or subs to replace existing subs in this module.
383 If you'll be working with perl 5.6.0 or greater, each of these files should begin with the line
385 no warnings qw(redefine);
387 so that perl does not kick and scream when you redefine a subroutine or variable in your overlay.
389 RT::Attachment_Overlay, RT::Attachment_Vendor, RT::Attachment_Local