Line 0
Link Here
|
|
|
1 |
use utf8; |
2 |
package Koha::Schema::Result::AuthProviderDomain; |
3 |
|
4 |
# Created by DBIx::Class::Schema::Loader |
5 |
# DO NOT MODIFY THE FIRST PART OF THIS FILE |
6 |
|
7 |
=head1 NAME |
8 |
|
9 |
Koha::Schema::Result::AuthProviderDomain |
10 |
|
11 |
=cut |
12 |
|
13 |
use strict; |
14 |
use warnings; |
15 |
|
16 |
use base 'DBIx::Class::Core'; |
17 |
|
18 |
=head1 TABLE: C<auth_provider_domains> |
19 |
|
20 |
=cut |
21 |
|
22 |
__PACKAGE__->table("auth_provider_domains"); |
23 |
|
24 |
=head1 ACCESSORS |
25 |
|
26 |
=head2 auth_provider_domain_id |
27 |
|
28 |
data_type: 'integer' |
29 |
is_auto_increment: 1 |
30 |
is_nullable: 0 |
31 |
|
32 |
unique key, used to identify providers domain |
33 |
|
34 |
=head2 auth_provider_id |
35 |
|
36 |
data_type: 'integer' |
37 |
is_foreign_key: 1 |
38 |
is_nullable: 0 |
39 |
|
40 |
Reference to provider |
41 |
|
42 |
=head2 domain |
43 |
|
44 |
data_type: 'varchar' |
45 |
is_nullable: 1 |
46 |
size: 100 |
47 |
|
48 |
Domain name. If null means all domains |
49 |
|
50 |
=head2 auto_register |
51 |
|
52 |
data_type: 'tinyint' |
53 |
default_value: 0 |
54 |
is_nullable: 0 |
55 |
|
56 |
Allow user auto register |
57 |
|
58 |
=head2 update_on_auth |
59 |
|
60 |
data_type: 'tinyint' |
61 |
default_value: 0 |
62 |
is_nullable: 0 |
63 |
|
64 |
Update user data on auth login |
65 |
|
66 |
=head2 default_library_id |
67 |
|
68 |
data_type: 'varchar' |
69 |
is_foreign_key: 1 |
70 |
is_nullable: 1 |
71 |
size: 10 |
72 |
|
73 |
Default library to create user if auto register is enabled |
74 |
|
75 |
=head2 default_category_id |
76 |
|
77 |
data_type: 'varchar' |
78 |
is_foreign_key: 1 |
79 |
is_nullable: 1 |
80 |
size: 10 |
81 |
|
82 |
Default category to create user if auto register is enabled |
83 |
|
84 |
=head2 allow_opac |
85 |
|
86 |
data_type: 'tinyint' |
87 |
default_value: 1 |
88 |
is_nullable: 0 |
89 |
|
90 |
Allow provider from opac interface |
91 |
|
92 |
=head2 allow_staff |
93 |
|
94 |
data_type: 'tinyint' |
95 |
default_value: 1 |
96 |
is_nullable: 0 |
97 |
|
98 |
Allow provider from staff interface |
99 |
|
100 |
=cut |
101 |
|
102 |
__PACKAGE__->add_columns( |
103 |
"auth_provider_domain_id", |
104 |
{ data_type => "integer", is_auto_increment => 1, is_nullable => 0 }, |
105 |
"auth_provider_id", |
106 |
{ data_type => "integer", is_foreign_key => 1, is_nullable => 0 }, |
107 |
"domain", |
108 |
{ data_type => "varchar", is_nullable => 1, size => 100 }, |
109 |
"auto_register", |
110 |
{ data_type => "tinyint", default_value => 0, is_nullable => 0 }, |
111 |
"update_on_auth", |
112 |
{ data_type => "tinyint", default_value => 0, is_nullable => 0 }, |
113 |
"default_library_id", |
114 |
{ data_type => "varchar", is_foreign_key => 1, is_nullable => 1, size => 10 }, |
115 |
"default_category_id", |
116 |
{ data_type => "varchar", is_foreign_key => 1, is_nullable => 1, size => 10 }, |
117 |
"allow_opac", |
118 |
{ data_type => "tinyint", default_value => 1, is_nullable => 0 }, |
119 |
"allow_staff", |
120 |
{ data_type => "tinyint", default_value => 1, is_nullable => 0 }, |
121 |
); |
122 |
|
123 |
=head1 PRIMARY KEY |
124 |
|
125 |
=over 4 |
126 |
|
127 |
=item * L</auth_provider_domain_id> |
128 |
|
129 |
=back |
130 |
|
131 |
=cut |
132 |
|
133 |
__PACKAGE__->set_primary_key("auth_provider_domain_id"); |
134 |
|
135 |
=head1 UNIQUE CONSTRAINTS |
136 |
|
137 |
=head2 C<auth_provider_id> |
138 |
|
139 |
=over 4 |
140 |
|
141 |
=item * L</auth_provider_id> |
142 |
|
143 |
=item * L</domain> |
144 |
|
145 |
=back |
146 |
|
147 |
=cut |
148 |
|
149 |
__PACKAGE__->add_unique_constraint("auth_provider_id", ["auth_provider_id", "domain"]); |
150 |
|
151 |
=head1 RELATIONS |
152 |
|
153 |
=head2 auth_provider |
154 |
|
155 |
Type: belongs_to |
156 |
|
157 |
Related object: L<Koha::Schema::Result::AuthProvider> |
158 |
|
159 |
=cut |
160 |
|
161 |
__PACKAGE__->belongs_to( |
162 |
"auth_provider", |
163 |
"Koha::Schema::Result::AuthProvider", |
164 |
{ auth_provider_id => "auth_provider_id" }, |
165 |
{ is_deferrable => 1, on_delete => "CASCADE", on_update => "RESTRICT" }, |
166 |
); |
167 |
|
168 |
=head2 default_category |
169 |
|
170 |
Type: belongs_to |
171 |
|
172 |
Related object: L<Koha::Schema::Result::Category> |
173 |
|
174 |
=cut |
175 |
|
176 |
__PACKAGE__->belongs_to( |
177 |
"default_category", |
178 |
"Koha::Schema::Result::Category", |
179 |
{ categorycode => "default_category_id" }, |
180 |
{ |
181 |
is_deferrable => 1, |
182 |
join_type => "LEFT", |
183 |
on_delete => "CASCADE", |
184 |
on_update => "RESTRICT", |
185 |
}, |
186 |
); |
187 |
|
188 |
=head2 default_library |
189 |
|
190 |
Type: belongs_to |
191 |
|
192 |
Related object: L<Koha::Schema::Result::Branch> |
193 |
|
194 |
=cut |
195 |
|
196 |
__PACKAGE__->belongs_to( |
197 |
"default_library", |
198 |
"Koha::Schema::Result::Branch", |
199 |
{ branchcode => "default_library_id" }, |
200 |
{ |
201 |
is_deferrable => 1, |
202 |
join_type => "LEFT", |
203 |
on_delete => "CASCADE", |
204 |
on_update => "RESTRICT", |
205 |
}, |
206 |
); |
207 |
|
208 |
|
209 |
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2022-08-24 15:03:07 |
210 |
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:1b0q+e8Ym8icJ6bYAY/Mbw |
211 |
|
212 |
sub koha_object_class { |
213 |
'Koha::Auth::Provider::Domain'; |
214 |
} |
215 |
sub koha_objects_class { |
216 |
'Koha::Auth::Providers::Domains'; |
217 |
} |
218 |
|
219 |
__PACKAGE__->add_columns( |
220 |
'+auto_register' => { is_boolean => 1 }, |
221 |
'+update_on_auth' => { is_boolean => 1 }, |
222 |
'+allow_opac' => { is_boolean => 1 }, |
223 |
'+allow_staff' => { is_boolean => 1 }, |
224 |
); |
225 |
|
226 |
1; |