import rt 3.6.4
[freeside.git] / rt / lib / RT / ObjectCustomFieldValue.pm
1 # BEGIN BPS TAGGED BLOCK {{{
2
3 # COPYRIGHT:
4 #  
5 # This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC 
6 #                                          <jesse@bestpractical.com>
7
8 # (Except where explicitly superseded by other copyright notices)
9
10
11 # LICENSE:
12
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
16 # from www.gnu.org.
17
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.
22
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/copyleft/gpl.html.
28
29
30 # CONTRIBUTION SUBMISSION POLICY:
31
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.)
37
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.
46
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.  
50
51 # !! DO NOT EDIT THIS FILE !!
52 #
53
54 use strict;
55
56
57 =head1 NAME
58
59 RT::ObjectCustomFieldValue
60
61
62 =head1 SYNOPSIS
63
64 =head1 DESCRIPTION
65
66 =head1 METHODS
67
68 =cut
69
70 package RT::ObjectCustomFieldValue;
71 use RT::Record; 
72 use RT::CustomField;
73
74
75 use vars qw( @ISA );
76 @ISA= qw( RT::Record );
77
78 sub _Init {
79   my $self = shift; 
80
81   $self->Table('ObjectCustomFieldValues');
82   $self->SUPER::_Init(@_);
83 }
84
85
86
87
88
89 =head2 Create PARAMHASH
90
91 Create takes a hash of values and creates a row in the database:
92
93   int(11) 'CustomField'.
94   varchar(255) 'ObjectType'.
95   int(11) 'ObjectId'.
96   int(11) 'SortOrder'.
97   varchar(255) 'Content'.
98   longtext 'LargeContent'.
99   varchar(80) 'ContentType'.
100   varchar(80) 'ContentEncoding'.
101   smallint(6) 'Disabled'.
102
103 =cut
104
105
106
107
108 sub Create {
109     my $self = shift;
110     my %args = ( 
111                 CustomField => '0',
112                 ObjectType => '',
113                 ObjectId => '0',
114                 SortOrder => '0',
115                 Content => '',
116                 LargeContent => '',
117                 ContentType => '',
118                 ContentEncoding => '',
119                 Disabled => '0',
120
121                   @_);
122     $self->SUPER::Create(
123                          CustomField => $args{'CustomField'},
124                          ObjectType => $args{'ObjectType'},
125                          ObjectId => $args{'ObjectId'},
126                          SortOrder => $args{'SortOrder'},
127                          Content => $args{'Content'},
128                          LargeContent => $args{'LargeContent'},
129                          ContentType => $args{'ContentType'},
130                          ContentEncoding => $args{'ContentEncoding'},
131                          Disabled => $args{'Disabled'},
132 );
133
134 }
135
136
137
138 =head2 id
139
140 Returns the current value of id. 
141 (In the database, id is stored as int(11).)
142
143
144 =cut
145
146
147 =head2 CustomField
148
149 Returns the current value of CustomField. 
150 (In the database, CustomField is stored as int(11).)
151
152
153
154 =head2 SetCustomField VALUE
155
156
157 Set CustomField to VALUE. 
158 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
159 (In the database, CustomField will be stored as a int(11).)
160
161
162 =cut
163
164
165 =head2 CustomFieldObj
166
167 Returns the CustomField Object which has the id returned by CustomField
168
169
170 =cut
171
172 sub CustomFieldObj {
173         my $self = shift;
174         my $CustomField =  RT::CustomField->new($self->CurrentUser);
175         $CustomField->Load($self->__Value('CustomField'));
176         return($CustomField);
177 }
178
179 =head2 ObjectType
180
181 Returns the current value of ObjectType. 
182 (In the database, ObjectType is stored as varchar(255).)
183
184
185
186 =head2 SetObjectType VALUE
187
188
189 Set ObjectType to VALUE. 
190 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
191 (In the database, ObjectType will be stored as a varchar(255).)
192
193
194 =cut
195
196
197 =head2 ObjectId
198
199 Returns the current value of ObjectId. 
200 (In the database, ObjectId is stored as int(11).)
201
202
203
204 =head2 SetObjectId VALUE
205
206
207 Set ObjectId to VALUE. 
208 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
209 (In the database, ObjectId will be stored as a int(11).)
210
211
212 =cut
213
214
215 =head2 SortOrder
216
217 Returns the current value of SortOrder. 
218 (In the database, SortOrder is stored as int(11).)
219
220
221
222 =head2 SetSortOrder VALUE
223
224
225 Set SortOrder to VALUE. 
226 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
227 (In the database, SortOrder will be stored as a int(11).)
228
229
230 =cut
231
232
233 =head2 Content
234
235 Returns the current value of Content. 
236 (In the database, Content is stored as varchar(255).)
237
238
239
240 =head2 SetContent VALUE
241
242
243 Set Content to VALUE. 
244 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
245 (In the database, Content will be stored as a varchar(255).)
246
247
248 =cut
249
250
251 =head2 LargeContent
252
253 Returns the current value of LargeContent. 
254 (In the database, LargeContent is stored as longtext.)
255
256
257
258 =head2 SetLargeContent VALUE
259
260
261 Set LargeContent to VALUE. 
262 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
263 (In the database, LargeContent will be stored as a longtext.)
264
265
266 =cut
267
268
269 =head2 ContentType
270
271 Returns the current value of ContentType. 
272 (In the database, ContentType is stored as varchar(80).)
273
274
275
276 =head2 SetContentType VALUE
277
278
279 Set ContentType to VALUE. 
280 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
281 (In the database, ContentType will be stored as a varchar(80).)
282
283
284 =cut
285
286
287 =head2 ContentEncoding
288
289 Returns the current value of ContentEncoding. 
290 (In the database, ContentEncoding is stored as varchar(80).)
291
292
293
294 =head2 SetContentEncoding VALUE
295
296
297 Set ContentEncoding to VALUE. 
298 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
299 (In the database, ContentEncoding will be stored as a varchar(80).)
300
301
302 =cut
303
304
305 =head2 Creator
306
307 Returns the current value of Creator. 
308 (In the database, Creator is stored as int(11).)
309
310
311 =cut
312
313
314 =head2 Created
315
316 Returns the current value of Created. 
317 (In the database, Created is stored as datetime.)
318
319
320 =cut
321
322
323 =head2 LastUpdatedBy
324
325 Returns the current value of LastUpdatedBy. 
326 (In the database, LastUpdatedBy is stored as int(11).)
327
328
329 =cut
330
331
332 =head2 LastUpdated
333
334 Returns the current value of LastUpdated. 
335 (In the database, LastUpdated is stored as datetime.)
336
337
338 =cut
339
340
341 =head2 Disabled
342
343 Returns the current value of Disabled. 
344 (In the database, Disabled is stored as smallint(6).)
345
346
347
348 =head2 SetDisabled VALUE
349
350
351 Set Disabled to VALUE. 
352 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
353 (In the database, Disabled will be stored as a smallint(6).)
354
355
356 =cut
357
358
359
360 sub _CoreAccessible {
361     {
362      
363         id =>
364                 {read => 1, sql_type => 4, length => 11,  is_blob => 0,  is_numeric => 1,  type => 'int(11)', default => ''},
365         CustomField => 
366                 {read => 1, write => 1, sql_type => 4, length => 11,  is_blob => 0,  is_numeric => 1,  type => 'int(11)', default => '0'},
367         ObjectType => 
368                 {read => 1, write => 1, sql_type => 12, length => 255,  is_blob => 0,  is_numeric => 0,  type => 'varchar(255)', default => ''},
369         ObjectId => 
370                 {read => 1, write => 1, sql_type => 4, length => 11,  is_blob => 0,  is_numeric => 1,  type => 'int(11)', default => '0'},
371         SortOrder => 
372                 {read => 1, write => 1, sql_type => 4, length => 11,  is_blob => 0,  is_numeric => 1,  type => 'int(11)', default => '0'},
373         Content => 
374                 {read => 1, write => 1, sql_type => 12, length => 255,  is_blob => 0,  is_numeric => 0,  type => 'varchar(255)', default => ''},
375         LargeContent => 
376                 {read => 1, write => 1, sql_type => -4, length => 0,  is_blob => 1,  is_numeric => 0,  type => 'longtext', default => ''},
377         ContentType => 
378                 {read => 1, write => 1, sql_type => 12, length => 80,  is_blob => 0,  is_numeric => 0,  type => 'varchar(80)', default => ''},
379         ContentEncoding => 
380                 {read => 1, write => 1, sql_type => 12, length => 80,  is_blob => 0,  is_numeric => 0,  type => 'varchar(80)', default => ''},
381         Creator => 
382                 {read => 1, auto => 1, sql_type => 4, length => 11,  is_blob => 0,  is_numeric => 1,  type => 'int(11)', default => '0'},
383         Created => 
384                 {read => 1, auto => 1, sql_type => 11, length => 0,  is_blob => 0,  is_numeric => 0,  type => 'datetime', default => ''},
385         LastUpdatedBy => 
386                 {read => 1, auto => 1, sql_type => 4, length => 11,  is_blob => 0,  is_numeric => 1,  type => 'int(11)', default => '0'},
387         LastUpdated => 
388                 {read => 1, auto => 1, sql_type => 11, length => 0,  is_blob => 0,  is_numeric => 0,  type => 'datetime', default => ''},
389         Disabled => 
390                 {read => 1, write => 1, sql_type => 5, length => 6,  is_blob => 0,  is_numeric => 1,  type => 'smallint(6)', default => '0'},
391
392  }
393 };
394
395
396         eval "require RT::ObjectCustomFieldValue_Overlay";
397         if ($@ && $@ !~ qr{^Can't locate RT/ObjectCustomFieldValue_Overlay.pm}) {
398             die $@;
399         };
400
401         eval "require RT::ObjectCustomFieldValue_Vendor";
402         if ($@ && $@ !~ qr{^Can't locate RT/ObjectCustomFieldValue_Vendor.pm}) {
403             die $@;
404         };
405
406         eval "require RT::ObjectCustomFieldValue_Local";
407         if ($@ && $@ !~ qr{^Can't locate RT/ObjectCustomFieldValue_Local.pm}) {
408             die $@;
409         };
410
411
412
413
414 =head1 SEE ALSO
415
416 This class allows "overlay" methods to be placed
417 into the following files _Overlay is for a System overlay by the original author,
418 _Vendor is for 3rd-party vendor add-ons, while _Local is for site-local customizations.  
419
420 These overlay files can contain new subs or subs to replace existing subs in this module.
421
422 Each of these files should begin with the line 
423
424    no warnings qw(redefine);
425
426 so that perl does not kick and scream when you redefine a subroutine or variable in your overlay.
427
428 RT::ObjectCustomFieldValue_Overlay, RT::ObjectCustomFieldValue_Vendor, RT::ObjectCustomFieldValue_Local
429
430 =cut
431
432
433 1;