1 # BEGIN BPS TAGGED BLOCK {{{
5 # This software is Copyright (c) 1996-2009 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., 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.
30 # CONTRIBUTION SUBMISSION POLICY:
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.)
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.
47 # END BPS TAGGED BLOCK }}}
49 # Autogenerated by DBIx::SearchBuilder factory (by <jesse@bestpractical.com>)
50 # WARNING: THIS FILE IS AUTOGENERATED. ALL CHANGES TO THIS FILE WILL BE LOST.
52 # !! DO NOT EDIT THIS FILE !!
71 package RT::Attachment;
76 @ISA= qw( RT::Record );
81 $self->Table('Attachments');
82 $self->SUPER::_Init(@_);
89 =head2 Create PARAMHASH
91 Create takes a hash of values and creates a row in the database:
93 int(11) 'TransactionId'.
95 varchar(160) 'MessageId'.
96 varchar(255) 'Subject'.
97 varchar(255) 'Filename'.
98 varchar(80) 'ContentType'.
99 varchar(80) 'ContentEncoding'.
111 TransactionId => '0',
117 ContentEncoding => '',
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'},
140 Returns the current value of id.
141 (In the database, id is stored as int(11).)
149 Returns the current value of TransactionId.
150 (In the database, TransactionId is stored as int(11).)
154 =head2 SetTransactionId VALUE
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).)
167 Returns the current value of Parent.
168 (In the database, Parent is stored as int(11).)
172 =head2 SetParent 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).)
185 Returns the current value of MessageId.
186 (In the database, MessageId is stored as varchar(160).)
190 =head2 SetMessageId VALUE
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).)
203 Returns the current value of Subject.
204 (In the database, Subject is stored as varchar(255).)
208 =head2 SetSubject VALUE
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).)
221 Returns the current value of Filename.
222 (In the database, Filename is stored as varchar(255).)
226 =head2 SetFilename VALUE
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).)
239 Returns the current value of ContentType.
240 (In the database, ContentType is stored as varchar(80).)
244 =head2 SetContentType VALUE
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).)
255 =head2 ContentEncoding
257 Returns the current value of ContentEncoding.
258 (In the database, ContentEncoding is stored as varchar(80).)
262 =head2 SetContentEncoding VALUE
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).)
275 Returns the current value of Content.
276 (In the database, Content is stored as longtext.)
280 =head2 SetContent VALUE
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.)
293 Returns the current value of Headers.
294 (In the database, Headers is stored as longtext.)
298 =head2 SetHeaders VALUE
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.)
311 Returns the current value of Creator.
312 (In the database, Creator is stored as int(11).)
320 Returns the current value of Created.
321 (In the database, Created is stored as datetime.)
328 sub _CoreAccessible {
332 {read => 1, sql_type => 4, length => 11, is_blob => 0, is_numeric => 1, type => 'int(11)', default => ''},
334 {read => 1, write => 1, sql_type => 4, length => 11, is_blob => 0, is_numeric => 1, type => 'int(11)', default => '0'},
336 {read => 1, write => 1, sql_type => 4, length => 11, is_blob => 0, is_numeric => 1, type => 'int(11)', default => '0'},
338 {read => 1, write => 1, sql_type => 12, length => 160, is_blob => 0, is_numeric => 0, type => 'varchar(160)', default => ''},
340 {read => 1, write => 1, sql_type => 12, length => 255, is_blob => 0, is_numeric => 0, type => 'varchar(255)', default => ''},
342 {read => 1, write => 1, sql_type => 12, length => 255, is_blob => 0, is_numeric => 0, type => 'varchar(255)', default => ''},
344 {read => 1, write => 1, sql_type => 12, length => 80, is_blob => 0, is_numeric => 0, type => 'varchar(80)', default => ''},
346 {read => 1, write => 1, sql_type => 12, length => 80, is_blob => 0, is_numeric => 0, type => 'varchar(80)', default => ''},
348 {read => 1, write => 1, sql_type => -4, length => 0, is_blob => 1, is_numeric => 0, type => 'longtext', default => ''},
350 {read => 1, write => 1, sql_type => -4, length => 0, is_blob => 1, is_numeric => 0, type => 'longtext', default => ''},
352 {read => 1, auto => 1, sql_type => 4, length => 11, is_blob => 0, is_numeric => 1, type => 'int(11)', default => '0'},
354 {read => 1, auto => 1, sql_type => 11, length => 0, is_blob => 0, is_numeric => 0, type => 'datetime', default => ''},
360 eval "require RT::Attachment_Overlay";
361 if ($@ && $@ !~ qr{^Can't locate RT/Attachment_Overlay.pm}) {
365 eval "require RT::Attachment_Vendor";
366 if ($@ && $@ !~ qr{^Can't locate RT/Attachment_Vendor.pm}) {
370 eval "require RT::Attachment_Local";
371 if ($@ && $@ !~ qr{^Can't locate RT/Attachment_Local.pm}) {
380 This class allows "overlay" methods to be placed
381 into the following files _Overlay is for a System overlay by the original author,
382 _Vendor is for 3rd-party vendor add-ons, while _Local is for site-local customizations.
384 These overlay files can contain new subs or subs to replace existing subs in this module.
386 Each of these files should begin with the line
388 no warnings qw(redefine);
390 so that perl does not kick and scream when you redefine a subroutine or variable in your overlay.
392 RT::Attachment_Overlay, RT::Attachment_Vendor, RT::Attachment_Local