Bug 25655: DBIC schema
[srvgit] / Koha / Schema / Result / IdentityProviderDomain.pm
1 use utf8;
2 package Koha::Schema::Result::IdentityProviderDomain;
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::IdentityProviderDomain
10
11 =cut
12
13 use strict;
14 use warnings;
15
16 use base 'DBIx::Class::Core';
17
18 =head1 TABLE: C<identity_provider_domains>
19
20 =cut
21
22 __PACKAGE__->table("identity_provider_domains");
23
24 =head1 ACCESSORS
25
26 =head2 identity_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 identity_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: 0
96   is_nullable: 0
97
98 Allow provider from staff interface
99
100 =cut
101
102 __PACKAGE__->add_columns(
103   "identity_provider_domain_id",
104   { data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
105   "identity_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 => 0, is_nullable => 0 },
121 );
122
123 =head1 PRIMARY KEY
124
125 =over 4
126
127 =item * L</identity_provider_domain_id>
128
129 =back
130
131 =cut
132
133 __PACKAGE__->set_primary_key("identity_provider_domain_id");
134
135 =head1 UNIQUE CONSTRAINTS
136
137 =head2 C<identity_provider_id>
138
139 =over 4
140
141 =item * L</identity_provider_id>
142
143 =item * L</domain>
144
145 =back
146
147 =cut
148
149 __PACKAGE__->add_unique_constraint("identity_provider_id", ["identity_provider_id", "domain"]);
150
151 =head1 RELATIONS
152
153 =head2 default_category
154
155 Type: belongs_to
156
157 Related object: L<Koha::Schema::Result::Category>
158
159 =cut
160
161 __PACKAGE__->belongs_to(
162   "default_category",
163   "Koha::Schema::Result::Category",
164   { categorycode => "default_category_id" },
165   {
166     is_deferrable => 1,
167     join_type     => "LEFT",
168     on_delete     => "CASCADE",
169     on_update     => "RESTRICT",
170   },
171 );
172
173 =head2 default_library
174
175 Type: belongs_to
176
177 Related object: L<Koha::Schema::Result::Branch>
178
179 =cut
180
181 __PACKAGE__->belongs_to(
182   "default_library",
183   "Koha::Schema::Result::Branch",
184   { branchcode => "default_library_id" },
185   {
186     is_deferrable => 1,
187     join_type     => "LEFT",
188     on_delete     => "CASCADE",
189     on_update     => "RESTRICT",
190   },
191 );
192
193 =head2 identity_provider
194
195 Type: belongs_to
196
197 Related object: L<Koha::Schema::Result::IdentityProvider>
198
199 =cut
200
201 __PACKAGE__->belongs_to(
202   "identity_provider",
203   "Koha::Schema::Result::IdentityProvider",
204   { identity_provider_id => "identity_provider_id" },
205   { is_deferrable => 1, on_delete => "CASCADE", on_update => "RESTRICT" },
206 );
207
208
209 # Created by DBIx::Class::Schema::Loader v0.07049 @ 2022-11-08 17:35:26
210 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:uUnzFzRKWAiYUsmapofXwQ
211
212 __PACKAGE__->add_columns(
213     '+auto_register'  => { is_boolean => 1 },
214     '+update_on_auth' => { is_boolean => 1 },
215     '+allow_opac'     => { is_boolean => 1 },
216     '+allow_staff'    => { is_boolean => 1 }
217 );
218
219 sub koha_object_class {
220     'Koha::Auth::Identity::Provider::Domain';
221 }
222 sub koha_objects_class {
223     'Koha::Auth::Identity::Provider::Domains';
224 }
225
226 1;