Bug 32257: Label for patron attributes misaligned
[koha-ffzg.git] / Koha / Schema / Result / BorrowerAttribute.pm
1 use utf8;
2 package Koha::Schema::Result::BorrowerAttribute;
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::BorrowerAttribute
10
11 =cut
12
13 use strict;
14 use warnings;
15
16 use base 'DBIx::Class::Core';
17
18 =head1 TABLE: C<borrower_attributes>
19
20 =cut
21
22 __PACKAGE__->table("borrower_attributes");
23
24 =head1 ACCESSORS
25
26 =head2 id
27
28   data_type: 'integer'
29   is_auto_increment: 1
30   is_nullable: 0
31
32 Row id field
33
34 =head2 borrowernumber
35
36   data_type: 'integer'
37   is_foreign_key: 1
38   is_nullable: 0
39
40 foreign key from the borrowers table, defines which patron/borrower has this attribute
41
42 =head2 code
43
44   data_type: 'varchar'
45   is_foreign_key: 1
46   is_nullable: 0
47   size: 10
48
49 foreign key from the borrower_attribute_types table, defines which custom field this value was entered for
50
51 =head2 attribute
52
53   data_type: 'varchar'
54   is_nullable: 1
55   size: 255
56
57 custom patron field value
58
59 =cut
60
61 __PACKAGE__->add_columns(
62   "id",
63   { data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
64   "borrowernumber",
65   { data_type => "integer", is_foreign_key => 1, is_nullable => 0 },
66   "code",
67   { data_type => "varchar", is_foreign_key => 1, is_nullable => 0, size => 10 },
68   "attribute",
69   { data_type => "varchar", is_nullable => 1, size => 255 },
70 );
71
72 =head1 PRIMARY KEY
73
74 =over 4
75
76 =item * L</id>
77
78 =back
79
80 =cut
81
82 __PACKAGE__->set_primary_key("id");
83
84 =head1 RELATIONS
85
86 =head2 borrowernumber
87
88 Type: belongs_to
89
90 Related object: L<Koha::Schema::Result::Borrower>
91
92 =cut
93
94 __PACKAGE__->belongs_to(
95   "borrowernumber",
96   "Koha::Schema::Result::Borrower",
97   { borrowernumber => "borrowernumber" },
98   { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
99 );
100
101 =head2 code
102
103 Type: belongs_to
104
105 Related object: L<Koha::Schema::Result::BorrowerAttributeType>
106
107 =cut
108
109 __PACKAGE__->belongs_to(
110   "code",
111   "Koha::Schema::Result::BorrowerAttributeType",
112   { code => "code" },
113   { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
114 );
115
116
117 # Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-01-21 13:39:29
118 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:P6K6sqVzIiwOgAAkAjQyiA
119
120 =head2 borrower_attribute_types
121
122 Type: belongs_to
123
124 Related object: L<Koha::Schema::Result::BorrowerAttributeType>
125
126 =cut
127
128 __PACKAGE__->belongs_to(
129     "borrower_attribute_types",
130     "Koha::Schema::Result::BorrowerAttributeType",
131     { "foreign.code" => "self.code" },
132     { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },);
133
134
135 sub koha_object_class {
136     'Koha::Patron::Attribute';
137 }
138 sub koha_objects_class {
139     'Koha::Patron::Attributes';
140 }
141
142 1;