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