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 displayed as a date
72 defines if this field is visible to patrons on their account in the OPAC (1 for yes, 0 for no)
80 defines if this field is editable by patrons on their account in the OPAC (1 for yes, 0 for no)
82 =head2 staff_searchable
88 defines if this field is searchable via the patron search in the staff interface (1 for yes, 0 for no)
90 =head2 searched_by_default
96 defines if this field is included in "Standard" patron searches in the staff interface (1 for yes, 0 for no)
98 =head2 authorised_value_category
104 foreign key from authorised_values that links this custom field to an authorized value category
106 =head2 display_checkout
112 defines if this field displays in checkout screens
121 defines a category for an attribute_type
126 default_value: (empty string)
130 defines a class for an attribute_type
132 =head2 keep_for_pseudonymization
138 defines if this field is copied to anonymized_borrower_attributes (1 for yes, 0 for no)
146 defines if the attribute is mandatory or not
150 __PACKAGE__->add_columns(
152 { data_type => "varchar", is_nullable => 0, size => 64 },
154 { data_type => "varchar", is_nullable => 0, size => 255 },
156 { data_type => "tinyint", default_value => 0, is_nullable => 0 },
158 { data_type => "tinyint", default_value => 0, is_nullable => 0 },
160 { data_type => "tinyint", default_value => 0, is_nullable => 0 },
162 { data_type => "tinyint", default_value => 0, is_nullable => 0 },
164 { data_type => "tinyint", default_value => 0, is_nullable => 0 },
166 { data_type => "tinyint", default_value => 0, is_nullable => 0 },
167 "searched_by_default",
168 { data_type => "tinyint", default_value => 0, is_nullable => 0 },
169 "authorised_value_category",
170 { data_type => "varchar", is_nullable => 1, size => 32 },
172 { data_type => "tinyint", default_value => 0, is_nullable => 0 },
174 { data_type => "varchar", is_foreign_key => 1, is_nullable => 1, size => 10 },
176 { data_type => "varchar", default_value => "", is_nullable => 0, size => 255 },
177 "keep_for_pseudonymization",
178 { data_type => "tinyint", default_value => 0, is_nullable => 0 },
180 { data_type => "tinyint", default_value => 0, is_nullable => 0 },
193 __PACKAGE__->set_primary_key("code");
197 =head2 borrower_attribute_types_branches
201 Related object: L<Koha::Schema::Result::BorrowerAttributeTypesBranch>
205 __PACKAGE__->has_many(
206 "borrower_attribute_types_branches",
207 "Koha::Schema::Result::BorrowerAttributeTypesBranch",
208 { "foreign.bat_code" => "self.code" },
209 { cascade_copy => 0, cascade_delete => 0 },
212 =head2 borrower_attributes
216 Related object: L<Koha::Schema::Result::BorrowerAttribute>
220 __PACKAGE__->has_many(
221 "borrower_attributes",
222 "Koha::Schema::Result::BorrowerAttribute",
223 { "foreign.code" => "self.code" },
224 { cascade_copy => 0, cascade_delete => 0 },
231 Related object: L<Koha::Schema::Result::Category>
235 __PACKAGE__->belongs_to(
237 "Koha::Schema::Result::Category",
238 { categorycode => "category_code" },
242 on_delete => "RESTRICT",
243 on_update => "RESTRICT",
247 =head2 pseudonymized_borrower_attributes
251 Related object: L<Koha::Schema::Result::PseudonymizedBorrowerAttribute>
255 __PACKAGE__->has_many(
256 "pseudonymized_borrower_attributes",
257 "Koha::Schema::Result::PseudonymizedBorrowerAttribute",
258 { "foreign.code" => "self.code" },
259 { cascade_copy => 0, cascade_delete => 0 },
263 # Created by DBIx::Class::Schema::Loader v0.07051 @ 2024-05-10 14:00:56
264 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:ZmiiXHqRGV2SDb4IgSPvJQ
266 __PACKAGE__->add_columns(
267 '+keep_for_pseudonymization' => { is_boolean => 1 },
268 '+mandatory' => { is_boolean => 1 },
269 '+searched_by_default' => { is_boolean => 1 },
270 '+staff_searchable' => { is_boolean => 1 },
273 __PACKAGE__->add_columns(
274 '+is_date' => { is_boolean => 1 },
277 sub koha_object_class {
278 'Koha::Patron::Attribute::Type';
280 sub koha_objects_class {
281 'Koha::Patron::Attribute::Types';