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