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 }}}
48 # Autogenerated by DBIx::SearchBuilder factory (by <jesse@bestpractical.com>)
49 # WARNING: THIS FILE IS AUTOGENERATED. ALL CHANGES TO THIS FILE WILL BE LOST.
51 # !! DO NOT EDIT THIS FILE !!
70 package RT::Attachment;
75 @ISA= qw( RT::Record );
80 $self->Table('Attachments');
81 $self->SUPER::_Init(@_);
88 =head2 Create PARAMHASH
90 Create takes a hash of values and creates a row in the database:
92 int(11) 'TransactionId'.
94 varchar(160) 'MessageId'.
95 varchar(255) 'Subject'.
96 varchar(255) 'Filename'.
97 varchar(80) 'ContentType'.
98 varchar(80) 'ContentEncoding'.
110 TransactionId => '0',
116 ContentEncoding => '',
121 $self->SUPER::Create(
122 TransactionId => $args{'TransactionId'},
123 Parent => $args{'Parent'},
124 MessageId => $args{'MessageId'},
125 Subject => $args{'Subject'},
126 Filename => $args{'Filename'},
127 ContentType => $args{'ContentType'},
128 ContentEncoding => $args{'ContentEncoding'},
129 Content => $args{'Content'},
130 Headers => $args{'Headers'},
139 Returns the current value of id.
140 (In the database, id is stored as int(11).)
148 Returns the current value of TransactionId.
149 (In the database, TransactionId is stored as int(11).)
153 =head2 SetTransactionId VALUE
156 Set TransactionId to VALUE.
157 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
158 (In the database, TransactionId will be stored as a int(11).)
166 Returns the current value of Parent.
167 (In the database, Parent is stored as int(11).)
171 =head2 SetParent VALUE
175 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
176 (In the database, Parent will be stored as a int(11).)
184 Returns the current value of MessageId.
185 (In the database, MessageId is stored as varchar(160).)
189 =head2 SetMessageId VALUE
192 Set MessageId to VALUE.
193 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
194 (In the database, MessageId will be stored as a varchar(160).)
202 Returns the current value of Subject.
203 (In the database, Subject is stored as varchar(255).)
207 =head2 SetSubject VALUE
210 Set Subject to VALUE.
211 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
212 (In the database, Subject will be stored as a varchar(255).)
220 Returns the current value of Filename.
221 (In the database, Filename is stored as varchar(255).)
225 =head2 SetFilename VALUE
228 Set Filename to VALUE.
229 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
230 (In the database, Filename will be stored as a varchar(255).)
238 Returns the current value of ContentType.
239 (In the database, ContentType is stored as varchar(80).)
243 =head2 SetContentType VALUE
246 Set ContentType to VALUE.
247 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
248 (In the database, ContentType will be stored as a varchar(80).)
254 =head2 ContentEncoding
256 Returns the current value of ContentEncoding.
257 (In the database, ContentEncoding is stored as varchar(80).)
261 =head2 SetContentEncoding VALUE
264 Set ContentEncoding to VALUE.
265 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
266 (In the database, ContentEncoding will be stored as a varchar(80).)
274 Returns the current value of Content.
275 (In the database, Content is stored as longtext.)
279 =head2 SetContent VALUE
282 Set Content to VALUE.
283 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
284 (In the database, Content will be stored as a longtext.)
292 Returns the current value of Headers.
293 (In the database, Headers is stored as longtext.)
297 =head2 SetHeaders VALUE
300 Set Headers to VALUE.
301 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
302 (In the database, Headers will be stored as a longtext.)
310 Returns the current value of Creator.
311 (In the database, Creator is stored as int(11).)
319 Returns the current value of Created.
320 (In the database, Created is stored as datetime.)
327 sub _CoreAccessible {
331 {read => 1, sql_type => 4, length => 11, is_blob => 0, is_numeric => 1, type => 'int(11)', default => ''},
333 {read => 1, write => 1, sql_type => 4, length => 11, is_blob => 0, is_numeric => 1, type => 'int(11)', default => '0'},
335 {read => 1, write => 1, sql_type => 4, length => 11, is_blob => 0, is_numeric => 1, type => 'int(11)', default => '0'},
337 {read => 1, write => 1, sql_type => 12, length => 160, is_blob => 0, is_numeric => 0, type => 'varchar(160)', default => ''},
339 {read => 1, write => 1, sql_type => 12, length => 255, is_blob => 0, is_numeric => 0, type => 'varchar(255)', default => ''},
341 {read => 1, write => 1, sql_type => 12, length => 255, is_blob => 0, is_numeric => 0, type => 'varchar(255)', default => ''},
343 {read => 1, write => 1, sql_type => 12, length => 80, is_blob => 0, is_numeric => 0, type => 'varchar(80)', default => ''},
345 {read => 1, write => 1, sql_type => 12, length => 80, is_blob => 0, is_numeric => 0, type => 'varchar(80)', default => ''},
347 {read => 1, write => 1, sql_type => -4, length => 0, is_blob => 1, is_numeric => 0, type => 'longtext', default => ''},
349 {read => 1, write => 1, sql_type => -4, length => 0, is_blob => 1, is_numeric => 0, type => 'longtext', default => ''},
351 {read => 1, auto => 1, sql_type => 4, length => 11, is_blob => 0, is_numeric => 1, type => 'int(11)', default => '0'},
353 {read => 1, auto => 1, sql_type => 11, length => 0, is_blob => 0, is_numeric => 0, type => 'datetime', default => ''},
359 eval "require RT::Attachment_Overlay";
360 if ($@ && $@ !~ qr{^Can't locate RT/Attachment_Overlay.pm}) {
364 eval "require RT::Attachment_Vendor";
365 if ($@ && $@ !~ qr{^Can't locate RT/Attachment_Vendor.pm}) {
369 eval "require RT::Attachment_Local";
370 if ($@ && $@ !~ qr{^Can't locate RT/Attachment_Local.pm}) {
379 This class allows "overlay" methods to be placed
380 into the following files _Overlay is for a System overlay by the original author,
381 _Vendor is for 3rd-party vendor add-ons, while _Local is for site-local customizations.
383 These overlay files can contain new subs or subs to replace existing subs in this module.
385 Each of these files should begin with the line
387 no warnings qw(redefine);
389 so that perl does not kick and scream when you redefine a subroutine or variable in your overlay.
391 RT::Attachment_Overlay, RT::Attachment_Vendor, RT::Attachment_Local