2 package Koha::Schema::Result::BorrowerAttributeType;
4 # Created by DBIx::Class::Schema::Loader
5 # DO NOT MODIFY THE FIRST PART OF THIS FILE
9 Koha::Schema::Result::BorrowerAttributeType
16 use base 'DBIx::Class::Core';
18 =head1 TABLE: C<borrower_attribute_types>
22 __PACKAGE__->table("borrower_attribute_types");
32 unique key used to identify each custom field
40 description for each custom field
48 defines whether one patron/borrower can have multiple values for this custom field (1 for yes, 0 for no)
56 defines if this value needs to be unique (1 for yes, 0 for no)
64 defines if this field is visible to patrons on their account in the OPAC (1 for yes, 0 for no)
72 defines if this field is editable by patrons on their account in the OPAC (1 for yes, 0 for no)
74 =head2 staff_searchable
80 defines if this field is searchable via the patron search in the staff interface (1 for yes, 0 for no)
82 =head2 authorised_value_category
88 foreign key from authorised_values that links this custom field to an authorized value category
90 =head2 display_checkout
96 defines if this field displays in checkout screens
105 defines a category for an attribute_type
110 default_value: (empty string)
114 defines a class for an attribute_type
116 =head2 keep_for_pseudonymization
122 defines if this field is copied to anonymized_borrower_attributes (1 for yes, 0 for no)
130 defines if the attribute is mandatory or not
134 __PACKAGE__->add_columns(
136 { data_type => "varchar", is_nullable => 0, size => 10 },
138 { data_type => "varchar", is_nullable => 0, size => 255 },
140 { data_type => "tinyint", default_value => 0, is_nullable => 0 },
142 { data_type => "tinyint", default_value => 0, is_nullable => 0 },
144 { data_type => "tinyint", default_value => 0, is_nullable => 0 },
146 { data_type => "tinyint", default_value => 0, is_nullable => 0 },
148 { data_type => "tinyint", default_value => 0, is_nullable => 0 },
149 "authorised_value_category",
150 { data_type => "varchar", is_nullable => 1, size => 32 },
152 { data_type => "tinyint", default_value => 0, is_nullable => 0 },
154 { data_type => "varchar", is_foreign_key => 1, is_nullable => 1, size => 10 },
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 },
160 { data_type => "tinyint", default_value => 0, is_nullable => 0 },
173 __PACKAGE__->set_primary_key("code");
177 =head2 borrower_attribute_types_branches
181 Related object: L<Koha::Schema::Result::BorrowerAttributeTypesBranch>
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 },
192 =head2 borrower_attributes
196 Related object: L<Koha::Schema::Result::BorrowerAttribute>
200 __PACKAGE__->has_many(
201 "borrower_attributes",
202 "Koha::Schema::Result::BorrowerAttribute",
203 { "foreign.code" => "self.code" },
204 { cascade_copy => 0, cascade_delete => 0 },
211 Related object: L<Koha::Schema::Result::Category>
215 __PACKAGE__->belongs_to(
217 "Koha::Schema::Result::Category",
218 { categorycode => "category_code" },
222 on_delete => "RESTRICT",
223 on_update => "RESTRICT",
227 =head2 pseudonymized_borrower_attributes
231 Related object: L<Koha::Schema::Result::PseudonymizedBorrowerAttribute>
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 },
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
246 __PACKAGE__->add_columns(
247 '+keep_for_pseudonymization' => { is_boolean => 1 },
250 __PACKAGE__->add_columns(
251 '+mandatory' => { is_boolean => 1 },
254 sub koha_object_class {
255 'Koha::Patron::Attribute::Type';
257 sub koha_objects_class {
258 'Koha::Patron::Attribute::Types';