import of rt 3.0.4
[freeside.git] / rt / lib / RT / CustomFieldValue.pm
1 # BEGIN LICENSE BLOCK
2
3 # Copyright (c) 1996-2003 Jesse Vincent <jesse@bestpractical.com>
4
5 # (Except where explictly superceded by other copyright notices)
6
7 # This work is made available to you under the terms of Version 2 of
8 # the GNU General Public License. A copy of that license should have
9 # been provided with this software, but in any event can be snarfed
10 # from www.gnu.org.
11
12 # This work is distributed in the hope that it will be useful, but
13 # WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15 # General Public License for more details.
16
17 # Unless otherwise specified, all modifications, corrections or
18 # extensions to this work which alter its source code become the
19 # property of Best Practical Solutions, LLC when submitted for
20 # inclusion in the work.
21
22
23 # END LICENSE BLOCK
24 # Autogenerated by DBIx::SearchBuilder factory (by <jesse@bestpractical.com>)
25 # WARNING: THIS FILE IS AUTOGENERATED. ALL CHANGES TO THIS FILE WILL BE LOST.  
26
27 # !! DO NOT EDIT THIS FILE !!
28 #
29
30 use strict;
31
32
33 =head1 NAME
34
35 RT::CustomFieldValue
36
37
38 =head1 SYNOPSIS
39
40 =head1 DESCRIPTION
41
42 =head1 METHODS
43
44 =cut
45
46 package RT::CustomFieldValue;
47 use RT::Record; 
48 use RT::CustomField;
49
50
51 use vars qw( @ISA );
52 @ISA= qw( RT::Record );
53
54 sub _Init {
55   my $self = shift; 
56
57   $self->Table('CustomFieldValues');
58   $self->SUPER::_Init(@_);
59 }
60
61
62
63
64
65 =item Create PARAMHASH
66
67 Create takes a hash of values and creates a row in the database:
68
69   int(11) 'CustomField'.
70   varchar(200) 'Name'.
71   varchar(255) 'Description'.
72   int(11) 'SortOrder'.
73
74 =cut
75
76
77
78
79 sub Create {
80     my $self = shift;
81     my %args = ( 
82                 CustomField => '0',
83                 Name => '',
84                 Description => '',
85                 SortOrder => '0',
86
87                   @_);
88     $self->SUPER::Create(
89                          CustomField => $args{'CustomField'},
90                          Name => $args{'Name'},
91                          Description => $args{'Description'},
92                          SortOrder => $args{'SortOrder'},
93 );
94
95 }
96
97
98
99 =item id
100
101 Returns the current value of id. 
102 (In the database, id is stored as int(11).)
103
104
105 =cut
106
107
108 =item CustomField
109
110 Returns the current value of CustomField. 
111 (In the database, CustomField is stored as int(11).)
112
113
114
115 =item SetCustomField VALUE
116
117
118 Set CustomField to VALUE. 
119 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
120 (In the database, CustomField will be stored as a int(11).)
121
122
123 =cut
124
125
126 =item CustomFieldObj
127
128 Returns the CustomField Object which has the id returned by CustomField
129
130
131 =cut
132
133 sub CustomFieldObj {
134         my $self = shift;
135         my $CustomField =  RT::CustomField->new($self->CurrentUser);
136         $CustomField->Load($self->__Value('CustomField'));
137         return($CustomField);
138 }
139
140 =item Name
141
142 Returns the current value of Name. 
143 (In the database, Name is stored as varchar(200).)
144
145
146
147 =item SetName VALUE
148
149
150 Set Name to VALUE. 
151 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
152 (In the database, Name will be stored as a varchar(200).)
153
154
155 =cut
156
157
158 =item Description
159
160 Returns the current value of Description. 
161 (In the database, Description is stored as varchar(255).)
162
163
164
165 =item SetDescription VALUE
166
167
168 Set Description to VALUE. 
169 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
170 (In the database, Description will be stored as a varchar(255).)
171
172
173 =cut
174
175
176 =item SortOrder
177
178 Returns the current value of SortOrder. 
179 (In the database, SortOrder is stored as int(11).)
180
181
182
183 =item SetSortOrder VALUE
184
185
186 Set SortOrder to VALUE. 
187 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
188 (In the database, SortOrder will be stored as a int(11).)
189
190
191 =cut
192
193
194 =item Creator
195
196 Returns the current value of Creator. 
197 (In the database, Creator is stored as int(11).)
198
199
200 =cut
201
202
203 =item Created
204
205 Returns the current value of Created. 
206 (In the database, Created is stored as datetime.)
207
208
209 =cut
210
211
212 =item LastUpdatedBy
213
214 Returns the current value of LastUpdatedBy. 
215 (In the database, LastUpdatedBy is stored as int(11).)
216
217
218 =cut
219
220
221 =item LastUpdated
222
223 Returns the current value of LastUpdated. 
224 (In the database, LastUpdated is stored as datetime.)
225
226
227 =cut
228
229
230
231 sub _ClassAccessible {
232     {
233      
234         id =>
235                 {read => 1, type => 'int(11)', default => ''},
236         CustomField => 
237                 {read => 1, write => 1, type => 'int(11)', default => '0'},
238         Name => 
239                 {read => 1, write => 1, type => 'varchar(200)', default => ''},
240         Description => 
241                 {read => 1, write => 1, type => 'varchar(255)', default => ''},
242         SortOrder => 
243                 {read => 1, write => 1, type => 'int(11)', default => '0'},
244         Creator => 
245                 {read => 1, auto => 1, type => 'int(11)', default => '0'},
246         Created => 
247                 {read => 1, auto => 1, type => 'datetime', default => ''},
248         LastUpdatedBy => 
249                 {read => 1, auto => 1, type => 'int(11)', default => '0'},
250         LastUpdated => 
251                 {read => 1, auto => 1, type => 'datetime', default => ''},
252
253  }
254 };
255
256
257         eval "require RT::CustomFieldValue_Overlay";
258         if ($@ && $@ !~ qr{^Can't locate RT/CustomFieldValue_Overlay.pm}) {
259             die $@;
260         };
261
262         eval "require RT::CustomFieldValue_Vendor";
263         if ($@ && $@ !~ qr{^Can't locate RT/CustomFieldValue_Vendor.pm}) {
264             die $@;
265         };
266
267         eval "require RT::CustomFieldValue_Local";
268         if ($@ && $@ !~ qr{^Can't locate RT/CustomFieldValue_Local.pm}) {
269             die $@;
270         };
271
272
273
274
275 =head1 SEE ALSO
276
277 This class allows "overlay" methods to be placed
278 into the following files _Overlay is for a System overlay by the original author,
279 _Vendor is for 3rd-party vendor add-ons, while _Local is for site-local customizations.  
280
281 These overlay files can contain new subs or subs to replace existing subs in this module.
282
283 If you'll be working with perl 5.6.0 or greater, each of these files should begin with the line 
284
285    no warnings qw(redefine);
286
287 so that perl does not kick and scream when you redefine a subroutine or variable in your overlay.
288
289 RT::CustomFieldValue_Overlay, RT::CustomFieldValue_Vendor, RT::CustomFieldValue_Local
290
291 =cut
292
293
294 1;