import rt 3.6.4
[freeside.git] / rt / lib / RT / ObjectCustomField.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::ObjectCustomField
60
61
62 =head1 SYNOPSIS
63
64 =head1 DESCRIPTION
65
66 =head1 METHODS
67
68 =cut
69
70 package RT::ObjectCustomField;
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('ObjectCustomFields');
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   int(11) 'ObjectId'.
95   int(11) 'SortOrder'.
96
97 =cut
98
99
100
101
102 sub Create {
103     my $self = shift;
104     my %args = ( 
105                 CustomField => '0',
106                 ObjectId => '0',
107                 SortOrder => '0',
108
109                   @_);
110     $self->SUPER::Create(
111                          CustomField => $args{'CustomField'},
112                          ObjectId => $args{'ObjectId'},
113                          SortOrder => $args{'SortOrder'},
114 );
115
116 }
117
118
119
120 =head2 id
121
122 Returns the current value of id. 
123 (In the database, id is stored as int(11).)
124
125
126 =cut
127
128
129 =head2 CustomField
130
131 Returns the current value of CustomField. 
132 (In the database, CustomField is stored as int(11).)
133
134
135
136 =head2 SetCustomField VALUE
137
138
139 Set CustomField to VALUE. 
140 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
141 (In the database, CustomField will be stored as a int(11).)
142
143
144 =cut
145
146
147 =head2 CustomFieldObj
148
149 Returns the CustomField Object which has the id returned by CustomField
150
151
152 =cut
153
154 sub CustomFieldObj {
155         my $self = shift;
156         my $CustomField =  RT::CustomField->new($self->CurrentUser);
157         $CustomField->Load($self->__Value('CustomField'));
158         return($CustomField);
159 }
160
161 =head2 ObjectId
162
163 Returns the current value of ObjectId. 
164 (In the database, ObjectId is stored as int(11).)
165
166
167
168 =head2 SetObjectId VALUE
169
170
171 Set ObjectId to VALUE. 
172 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
173 (In the database, ObjectId will be stored as a int(11).)
174
175
176 =cut
177
178
179 =head2 SortOrder
180
181 Returns the current value of SortOrder. 
182 (In the database, SortOrder is stored as int(11).)
183
184
185
186 =head2 SetSortOrder VALUE
187
188
189 Set SortOrder to VALUE. 
190 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
191 (In the database, SortOrder will be stored as a int(11).)
192
193
194 =cut
195
196
197 =head2 Creator
198
199 Returns the current value of Creator. 
200 (In the database, Creator is stored as int(11).)
201
202
203 =cut
204
205
206 =head2 Created
207
208 Returns the current value of Created. 
209 (In the database, Created is stored as datetime.)
210
211
212 =cut
213
214
215 =head2 LastUpdatedBy
216
217 Returns the current value of LastUpdatedBy. 
218 (In the database, LastUpdatedBy is stored as int(11).)
219
220
221 =cut
222
223
224 =head2 LastUpdated
225
226 Returns the current value of LastUpdated. 
227 (In the database, LastUpdated is stored as datetime.)
228
229
230 =cut
231
232
233
234 sub _CoreAccessible {
235     {
236      
237         id =>
238                 {read => 1, sql_type => 4, length => 11,  is_blob => 0,  is_numeric => 1,  type => 'int(11)', default => ''},
239         CustomField => 
240                 {read => 1, write => 1, sql_type => 4, length => 11,  is_blob => 0,  is_numeric => 1,  type => 'int(11)', default => '0'},
241         ObjectId => 
242                 {read => 1, write => 1, sql_type => 4, length => 11,  is_blob => 0,  is_numeric => 1,  type => 'int(11)', default => '0'},
243         SortOrder => 
244                 {read => 1, write => 1, sql_type => 4, length => 11,  is_blob => 0,  is_numeric => 1,  type => 'int(11)', default => '0'},
245         Creator => 
246                 {read => 1, auto => 1, sql_type => 4, length => 11,  is_blob => 0,  is_numeric => 1,  type => 'int(11)', default => '0'},
247         Created => 
248                 {read => 1, auto => 1, sql_type => 11, length => 0,  is_blob => 0,  is_numeric => 0,  type => 'datetime', default => ''},
249         LastUpdatedBy => 
250                 {read => 1, auto => 1, sql_type => 4, length => 11,  is_blob => 0,  is_numeric => 1,  type => 'int(11)', default => '0'},
251         LastUpdated => 
252                 {read => 1, auto => 1, sql_type => 11, length => 0,  is_blob => 0,  is_numeric => 0,  type => 'datetime', default => ''},
253
254  }
255 };
256
257
258         eval "require RT::ObjectCustomField_Overlay";
259         if ($@ && $@ !~ qr{^Can't locate RT/ObjectCustomField_Overlay.pm}) {
260             die $@;
261         };
262
263         eval "require RT::ObjectCustomField_Vendor";
264         if ($@ && $@ !~ qr{^Can't locate RT/ObjectCustomField_Vendor.pm}) {
265             die $@;
266         };
267
268         eval "require RT::ObjectCustomField_Local";
269         if ($@ && $@ !~ qr{^Can't locate RT/ObjectCustomField_Local.pm}) {
270             die $@;
271         };
272
273
274
275
276 =head1 SEE ALSO
277
278 This class allows "overlay" methods to be placed
279 into the following files _Overlay is for a System overlay by the original author,
280 _Vendor is for 3rd-party vendor add-ons, while _Local is for site-local customizations.  
281
282 These overlay files can contain new subs or subs to replace existing subs in this module.
283
284 Each of these files should begin with the line 
285
286    no warnings qw(redefine);
287
288 so that perl does not kick and scream when you redefine a subroutine or variable in your overlay.
289
290 RT::ObjectCustomField_Overlay, RT::ObjectCustomField_Vendor, RT::ObjectCustomField_Local
291
292 =cut
293
294
295 1;