import of rt 3.0.4
[freeside.git] / rt / lib / RT / Principal.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::Principal
36
37
38 =head1 SYNOPSIS
39
40 =head1 DESCRIPTION
41
42 =head1 METHODS
43
44 =cut
45
46 package RT::Principal;
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('Principals');
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(16) 'PrincipalType'.
69   int(11) 'ObjectId'.
70   smallint(6) 'Disabled'.
71
72 =cut
73
74
75
76
77 sub Create {
78     my $self = shift;
79     my %args = ( 
80                 PrincipalType => '',
81                 ObjectId => '',
82                 Disabled => '0',
83
84                   @_);
85     $self->SUPER::Create(
86                          PrincipalType => $args{'PrincipalType'},
87                          ObjectId => $args{'ObjectId'},
88                          Disabled => $args{'Disabled'},
89 );
90
91 }
92
93
94
95 =item id
96
97 Returns the current value of id. 
98 (In the database, id is stored as int(11).)
99
100
101 =cut
102
103
104 =item PrincipalType
105
106 Returns the current value of PrincipalType. 
107 (In the database, PrincipalType is stored as varchar(16).)
108
109
110
111 =item SetPrincipalType VALUE
112
113
114 Set PrincipalType to VALUE. 
115 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
116 (In the database, PrincipalType will be stored as a varchar(16).)
117
118
119 =cut
120
121
122 =item ObjectId
123
124 Returns the current value of ObjectId. 
125 (In the database, ObjectId is stored as int(11).)
126
127
128
129 =item SetObjectId VALUE
130
131
132 Set ObjectId to VALUE. 
133 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
134 (In the database, ObjectId will be stored as a int(11).)
135
136
137 =cut
138
139
140 =item Disabled
141
142 Returns the current value of Disabled. 
143 (In the database, Disabled is stored as smallint(6).)
144
145
146
147 =item SetDisabled VALUE
148
149
150 Set Disabled to VALUE. 
151 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
152 (In the database, Disabled will be stored as a smallint(6).)
153
154
155 =cut
156
157
158
159 sub _ClassAccessible {
160     {
161      
162         id =>
163                 {read => 1, type => 'int(11)', default => ''},
164         PrincipalType => 
165                 {read => 1, write => 1, type => 'varchar(16)', default => ''},
166         ObjectId => 
167                 {read => 1, write => 1, type => 'int(11)', default => ''},
168         Disabled => 
169                 {read => 1, write => 1, type => 'smallint(6)', default => '0'},
170
171  }
172 };
173
174
175         eval "require RT::Principal_Overlay";
176         if ($@ && $@ !~ qr{^Can't locate RT/Principal_Overlay.pm}) {
177             die $@;
178         };
179
180         eval "require RT::Principal_Vendor";
181         if ($@ && $@ !~ qr{^Can't locate RT/Principal_Vendor.pm}) {
182             die $@;
183         };
184
185         eval "require RT::Principal_Local";
186         if ($@ && $@ !~ qr{^Can't locate RT/Principal_Local.pm}) {
187             die $@;
188         };
189
190
191
192
193 =head1 SEE ALSO
194
195 This class allows "overlay" methods to be placed
196 into the following files _Overlay is for a System overlay by the original author,
197 _Vendor is for 3rd-party vendor add-ons, while _Local is for site-local customizations.  
198
199 These overlay files can contain new subs or subs to replace existing subs in this module.
200
201 If you'll be working with perl 5.6.0 or greater, each of these files should begin with the line 
202
203    no warnings qw(redefine);
204
205 so that perl does not kick and scream when you redefine a subroutine or variable in your overlay.
206
207 RT::Principal_Overlay, RT::Principal_Vendor, RT::Principal_Local
208
209 =cut
210
211
212 1;