import of rt 3.0.9
[freeside.git] / rt / lib / RT / TicketCustomFieldValue.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::TicketCustomFieldValue
36
37
38 =head1 SYNOPSIS
39
40 =head1 DESCRIPTION
41
42 =head1 METHODS
43
44 =cut
45
46 package RT::TicketCustomFieldValue;
47 use RT::Record; 
48 use RT::CustomField;
49 use RT::Ticket;
50
51
52 use vars qw( @ISA );
53 @ISA= qw( RT::Record );
54
55 sub _Init {
56   my $self = shift; 
57
58   $self->Table('TicketCustomFieldValues');
59   $self->SUPER::_Init(@_);
60 }
61
62
63
64
65
66 =item Create PARAMHASH
67
68 Create takes a hash of values and creates a row in the database:
69
70   int(11) 'Ticket'.
71   int(11) 'CustomField'.
72   varchar(255) 'Content'.
73
74 =cut
75
76
77
78
79 sub Create {
80     my $self = shift;
81     my %args = ( 
82                 Ticket => '0',
83                 CustomField => '0',
84                 Content => '',
85
86                   @_);
87     $self->SUPER::Create(
88                          Ticket => $args{'Ticket'},
89                          CustomField => $args{'CustomField'},
90                          Content => $args{'Content'},
91 );
92
93 }
94
95
96
97 =item id
98
99 Returns the current value of id. 
100 (In the database, id is stored as int(11).)
101
102
103 =cut
104
105
106 =item Ticket
107
108 Returns the current value of Ticket. 
109 (In the database, Ticket is stored as int(11).)
110
111
112
113 =item SetTicket VALUE
114
115
116 Set Ticket to VALUE. 
117 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
118 (In the database, Ticket will be stored as a int(11).)
119
120
121 =cut
122
123
124 =item TicketObj
125
126 Returns the Ticket Object which has the id returned by Ticket
127
128
129 =cut
130
131 sub TicketObj {
132         my $self = shift;
133         my $Ticket =  RT::Ticket->new($self->CurrentUser);
134         $Ticket->Load($self->__Value('Ticket'));
135         return($Ticket);
136 }
137
138 =item CustomField
139
140 Returns the current value of CustomField. 
141 (In the database, CustomField is stored as int(11).)
142
143
144
145 =item SetCustomField VALUE
146
147
148 Set CustomField to VALUE. 
149 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
150 (In the database, CustomField will be stored as a int(11).)
151
152
153 =cut
154
155
156 =item CustomFieldObj
157
158 Returns the CustomField Object which has the id returned by CustomField
159
160
161 =cut
162
163 sub CustomFieldObj {
164         my $self = shift;
165         my $CustomField =  RT::CustomField->new($self->CurrentUser);
166         $CustomField->Load($self->__Value('CustomField'));
167         return($CustomField);
168 }
169
170 =item Content
171
172 Returns the current value of Content. 
173 (In the database, Content is stored as varchar(255).)
174
175
176
177 =item SetContent VALUE
178
179
180 Set Content to VALUE. 
181 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
182 (In the database, Content will be stored as a varchar(255).)
183
184
185 =cut
186
187
188 =item Creator
189
190 Returns the current value of Creator. 
191 (In the database, Creator is stored as int(11).)
192
193
194 =cut
195
196
197 =item Created
198
199 Returns the current value of Created. 
200 (In the database, Created is stored as datetime.)
201
202
203 =cut
204
205
206 =item LastUpdatedBy
207
208 Returns the current value of LastUpdatedBy. 
209 (In the database, LastUpdatedBy is stored as int(11).)
210
211
212 =cut
213
214
215 =item LastUpdated
216
217 Returns the current value of LastUpdated. 
218 (In the database, LastUpdated is stored as datetime.)
219
220
221 =cut
222
223
224
225 sub _ClassAccessible {
226     {
227      
228         id =>
229                 {read => 1, type => 'int(11)', default => ''},
230         Ticket => 
231                 {read => 1, write => 1, type => 'int(11)', default => '0'},
232         CustomField => 
233                 {read => 1, write => 1, type => 'int(11)', default => '0'},
234         Content => 
235                 {read => 1, write => 1, type => 'varchar(255)', default => ''},
236         Creator => 
237                 {read => 1, auto => 1, type => 'int(11)', default => '0'},
238         Created => 
239                 {read => 1, auto => 1, type => 'datetime', default => ''},
240         LastUpdatedBy => 
241                 {read => 1, auto => 1, type => 'int(11)', default => '0'},
242         LastUpdated => 
243                 {read => 1, auto => 1, type => 'datetime', default => ''},
244
245  }
246 };
247
248
249         eval "require RT::TicketCustomFieldValue_Overlay";
250         if ($@ && $@ !~ qr{^Can't locate RT/TicketCustomFieldValue_Overlay.pm}) {
251             die $@;
252         };
253
254         eval "require RT::TicketCustomFieldValue_Vendor";
255         if ($@ && $@ !~ qr{^Can't locate RT/TicketCustomFieldValue_Vendor.pm}) {
256             die $@;
257         };
258
259         eval "require RT::TicketCustomFieldValue_Local";
260         if ($@ && $@ !~ qr{^Can't locate RT/TicketCustomFieldValue_Local.pm}) {
261             die $@;
262         };
263
264
265
266
267 =head1 SEE ALSO
268
269 This class allows "overlay" methods to be placed
270 into the following files _Overlay is for a System overlay by the original author,
271 _Vendor is for 3rd-party vendor add-ons, while _Local is for site-local customizations.  
272
273 These overlay files can contain new subs or subs to replace existing subs in this module.
274
275 If you'll be working with perl 5.6.0 or greater, each of these files should begin with the line 
276
277    no warnings qw(redefine);
278
279 so that perl does not kick and scream when you redefine a subroutine or variable in your overlay.
280
281 RT::TicketCustomFieldValue_Overlay, RT::TicketCustomFieldValue_Vendor, RT::TicketCustomFieldValue_Local
282
283 =cut
284
285
286 1;