Bug 32257: Label for patron attributes misaligned
[koha-ffzg.git] / Koha / Schema / Result / BorrowerAttributeType.pm
1 use utf8;
2 package Koha::Schema::Result::BorrowerAttributeType;
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::BorrowerAttributeType
10
11 =cut
12
13 use strict;
14 use warnings;
15
16 use base 'DBIx::Class::Core';
17
18 =head1 TABLE: C<borrower_attribute_types>
19
20 =cut
21
22 __PACKAGE__->table("borrower_attribute_types");
23
24 =head1 ACCESSORS
25
26 =head2 code
27
28   data_type: 'varchar'
29   is_nullable: 0
30   size: 10
31
32 unique key used to identify each custom field
33
34 =head2 description
35
36   data_type: 'varchar'
37   is_nullable: 0
38   size: 255
39
40 description for each custom field
41
42 =head2 repeatable
43
44   data_type: 'tinyint'
45   default_value: 0
46   is_nullable: 0
47
48 defines whether one patron/borrower can have multiple values for this custom field  (1 for yes, 0 for no)
49
50 =head2 unique_id
51
52   data_type: 'tinyint'
53   default_value: 0
54   is_nullable: 0
55
56 defines if this value needs to be unique (1 for yes, 0 for no)
57
58 =head2 opac_display
59
60   data_type: 'tinyint'
61   default_value: 0
62   is_nullable: 0
63
64 defines if this field is visible to patrons on their account in the OPAC (1 for yes, 0 for no)
65
66 =head2 opac_editable
67
68   data_type: 'tinyint'
69   default_value: 0
70   is_nullable: 0
71
72 defines if this field is editable by patrons on their account in the OPAC (1 for yes, 0 for no)
73
74 =head2 staff_searchable
75
76   data_type: 'tinyint'
77   default_value: 0
78   is_nullable: 0
79
80 defines if this field is searchable via the patron search in the staff interface (1 for yes, 0 for no)
81
82 =head2 authorised_value_category
83
84   data_type: 'varchar'
85   is_nullable: 1
86   size: 32
87
88 foreign key from authorised_values that links this custom field to an authorized value category
89
90 =head2 display_checkout
91
92   data_type: 'tinyint'
93   default_value: 0
94   is_nullable: 0
95
96 defines if this field displays in checkout screens
97
98 =head2 category_code
99
100   data_type: 'varchar'
101   is_foreign_key: 1
102   is_nullable: 1
103   size: 10
104
105 defines a category for an attribute_type
106
107 =head2 class
108
109   data_type: 'varchar'
110   default_value: (empty string)
111   is_nullable: 0
112   size: 255
113
114 defines a class for an attribute_type
115
116 =head2 keep_for_pseudonymization
117
118   data_type: 'tinyint'
119   default_value: 0
120   is_nullable: 0
121
122 defines if this field is copied to anonymized_borrower_attributes (1 for yes, 0 for no)
123
124 =head2 mandatory
125
126   data_type: 'tinyint'
127   default_value: 0
128   is_nullable: 0
129
130 defines if the attribute is mandatory or not
131
132 =cut
133
134 __PACKAGE__->add_columns(
135   "code",
136   { data_type => "varchar", is_nullable => 0, size => 10 },
137   "description",
138   { data_type => "varchar", is_nullable => 0, size => 255 },
139   "repeatable",
140   { data_type => "tinyint", default_value => 0, is_nullable => 0 },
141   "unique_id",
142   { data_type => "tinyint", default_value => 0, is_nullable => 0 },
143   "opac_display",
144   { data_type => "tinyint", default_value => 0, is_nullable => 0 },
145   "opac_editable",
146   { data_type => "tinyint", default_value => 0, is_nullable => 0 },
147   "staff_searchable",
148   { data_type => "tinyint", default_value => 0, is_nullable => 0 },
149   "authorised_value_category",
150   { data_type => "varchar", is_nullable => 1, size => 32 },
151   "display_checkout",
152   { data_type => "tinyint", default_value => 0, is_nullable => 0 },
153   "category_code",
154   { data_type => "varchar", is_foreign_key => 1, is_nullable => 1, size => 10 },
155   "class",
156   { data_type => "varchar", default_value => "", is_nullable => 0, size => 255 },
157   "keep_for_pseudonymization",
158   { data_type => "tinyint", default_value => 0, is_nullable => 0 },
159   "mandatory",
160   { data_type => "tinyint", default_value => 0, is_nullable => 0 },
161 );
162
163 =head1 PRIMARY KEY
164
165 =over 4
166
167 =item * L</code>
168
169 =back
170
171 =cut
172
173 __PACKAGE__->set_primary_key("code");
174
175 =head1 RELATIONS
176
177 =head2 borrower_attribute_types_branches
178
179 Type: has_many
180
181 Related object: L<Koha::Schema::Result::BorrowerAttributeTypesBranch>
182
183 =cut
184
185 __PACKAGE__->has_many(
186   "borrower_attribute_types_branches",
187   "Koha::Schema::Result::BorrowerAttributeTypesBranch",
188   { "foreign.bat_code" => "self.code" },
189   { cascade_copy => 0, cascade_delete => 0 },
190 );
191
192 =head2 borrower_attributes
193
194 Type: has_many
195
196 Related object: L<Koha::Schema::Result::BorrowerAttribute>
197
198 =cut
199
200 __PACKAGE__->has_many(
201   "borrower_attributes",
202   "Koha::Schema::Result::BorrowerAttribute",
203   { "foreign.code" => "self.code" },
204   { cascade_copy => 0, cascade_delete => 0 },
205 );
206
207 =head2 category_code
208
209 Type: belongs_to
210
211 Related object: L<Koha::Schema::Result::Category>
212
213 =cut
214
215 __PACKAGE__->belongs_to(
216   "category_code",
217   "Koha::Schema::Result::Category",
218   { categorycode => "category_code" },
219   {
220     is_deferrable => 1,
221     join_type     => "LEFT",
222     on_delete     => "RESTRICT",
223     on_update     => "RESTRICT",
224   },
225 );
226
227 =head2 pseudonymized_borrower_attributes
228
229 Type: has_many
230
231 Related object: L<Koha::Schema::Result::PseudonymizedBorrowerAttribute>
232
233 =cut
234
235 __PACKAGE__->has_many(
236   "pseudonymized_borrower_attributes",
237   "Koha::Schema::Result::PseudonymizedBorrowerAttribute",
238   { "foreign.code" => "self.code" },
239   { cascade_copy => 0, cascade_delete => 0 },
240 );
241
242
243 # Created by DBIx::Class::Schema::Loader v0.07049 @ 2022-04-25 12:50:55
244 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:VgJP4Ugfz0sN3YoJk/tshA
245
246 __PACKAGE__->add_columns(
247     '+keep_for_pseudonymization' => { is_boolean => 1 },
248 );
249
250 __PACKAGE__->add_columns(
251     '+mandatory' => { is_boolean => 1 },
252 );
253
254 sub koha_object_class {
255     'Koha::Patron::Attribute::Type';
256 }
257 sub koha_objects_class {
258     'Koha::Patron::Attribute::Types';
259 }
260
261 1;