Bug 32257: Label for patron attributes misaligned
[koha-ffzg.git] / Koha / Schema / Result / ErmUserRole.pm
1 use utf8;
2 package Koha::Schema::Result::ErmUserRole;
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::ErmUserRole
10
11 =cut
12
13 use strict;
14 use warnings;
15
16 use base 'DBIx::Class::Core';
17
18 =head1 TABLE: C<erm_user_roles>
19
20 =cut
21
22 __PACKAGE__->table("erm_user_roles");
23
24 =head1 ACCESSORS
25
26 =head2 user_role_id
27
28   data_type: 'integer'
29   is_auto_increment: 1
30   is_nullable: 0
31
32 primary key
33
34 =head2 agreement_id
35
36   data_type: 'integer'
37   is_foreign_key: 1
38   is_nullable: 1
39
40 link to the agreement
41
42 =head2 license_id
43
44   data_type: 'integer'
45   is_foreign_key: 1
46   is_nullable: 1
47
48 link to the license
49
50 =head2 user_id
51
52   data_type: 'integer'
53   is_foreign_key: 1
54   is_nullable: 0
55
56 link to the user
57
58 =head2 role
59
60   data_type: 'varchar'
61   is_nullable: 0
62   size: 80
63
64 role of the user
65
66 =cut
67
68 __PACKAGE__->add_columns(
69   "user_role_id",
70   { data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
71   "agreement_id",
72   { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
73   "license_id",
74   { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
75   "user_id",
76   { data_type => "integer", is_foreign_key => 1, is_nullable => 0 },
77   "role",
78   { data_type => "varchar", is_nullable => 0, size => 80 },
79 );
80
81 =head1 PRIMARY KEY
82
83 =over 4
84
85 =item * L</user_role_id>
86
87 =back
88
89 =cut
90
91 __PACKAGE__->set_primary_key("user_role_id");
92
93 =head1 RELATIONS
94
95 =head2 agreement
96
97 Type: belongs_to
98
99 Related object: L<Koha::Schema::Result::ErmAgreement>
100
101 =cut
102
103 __PACKAGE__->belongs_to(
104   "agreement",
105   "Koha::Schema::Result::ErmAgreement",
106   { agreement_id => "agreement_id" },
107   {
108     is_deferrable => 1,
109     join_type     => "LEFT",
110     on_delete     => "CASCADE",
111     on_update     => "CASCADE",
112   },
113 );
114
115 =head2 license
116
117 Type: belongs_to
118
119 Related object: L<Koha::Schema::Result::ErmLicense>
120
121 =cut
122
123 __PACKAGE__->belongs_to(
124   "license",
125   "Koha::Schema::Result::ErmLicense",
126   { license_id => "license_id" },
127   {
128     is_deferrable => 1,
129     join_type     => "LEFT",
130     on_delete     => "CASCADE",
131     on_update     => "CASCADE",
132   },
133 );
134
135 =head2 user
136
137 Type: belongs_to
138
139 Related object: L<Koha::Schema::Result::Borrower>
140
141 =cut
142
143 __PACKAGE__->belongs_to(
144   "user",
145   "Koha::Schema::Result::Borrower",
146   { borrowernumber => "user_id" },
147   { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
148 );
149
150
151 # Created by DBIx::Class::Schema::Loader v0.07049 @ 2022-11-16 12:23:11
152 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:HbkogqUuTLQCaUY1VrT6Hw
153
154 sub koha_object_class {
155     'Koha::ERM::UserRole';
156 }
157 sub koha_objects_class {
158     'Koha::ERM::UserRoles';
159 }
160
161 1;