Bug 32030: DBIC Specific
[koha.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 agreement_id
27
28   data_type: 'integer'
29   is_foreign_key: 1
30   is_nullable: 1
31
32 link to the agreement
33
34 =head2 license_id
35
36   data_type: 'integer'
37   is_foreign_key: 1
38   is_nullable: 1
39
40 link to the license
41
42 =head2 user_id
43
44   data_type: 'integer'
45   is_foreign_key: 1
46   is_nullable: 0
47
48 link to the user
49
50 =head2 role
51
52   data_type: 'varchar'
53   is_nullable: 0
54   size: 80
55
56 role of the user
57
58 =cut
59
60 __PACKAGE__->add_columns(
61   "agreement_id",
62   { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
63   "license_id",
64   { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
65   "user_id",
66   { data_type => "integer", is_foreign_key => 1, is_nullable => 0 },
67   "role",
68   { data_type => "varchar", is_nullable => 0, size => 80 },
69 );
70
71 =head1 RELATIONS
72
73 =head2 agreement
74
75 Type: belongs_to
76
77 Related object: L<Koha::Schema::Result::ErmAgreement>
78
79 =cut
80
81 __PACKAGE__->belongs_to(
82   "agreement",
83   "Koha::Schema::Result::ErmAgreement",
84   { agreement_id => "agreement_id" },
85   {
86     is_deferrable => 1,
87     join_type     => "LEFT",
88     on_delete     => "CASCADE",
89     on_update     => "CASCADE",
90   },
91 );
92
93 =head2 license
94
95 Type: belongs_to
96
97 Related object: L<Koha::Schema::Result::ErmLicense>
98
99 =cut
100
101 __PACKAGE__->belongs_to(
102   "license",
103   "Koha::Schema::Result::ErmLicense",
104   { license_id => "license_id" },
105   {
106     is_deferrable => 1,
107     join_type     => "LEFT",
108     on_delete     => "CASCADE",
109     on_update     => "CASCADE",
110   },
111 );
112
113 =head2 user
114
115 Type: belongs_to
116
117 Related object: L<Koha::Schema::Result::Borrower>
118
119 =cut
120
121 __PACKAGE__->belongs_to(
122   "user",
123   "Koha::Schema::Result::Borrower",
124   { borrowernumber => "user_id" },
125   { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
126 );
127
128
129 # Created by DBIx::Class::Schema::Loader v0.07049 @ 2022-11-01 07:44:13
130 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:RkK5cQWFEmcrDioAfjOVWQ
131
132 sub koha_object_class {
133     'Koha::ERM::Agreement::UserRole';
134 }
135 sub koha_objects_class {
136     'Koha::ERM::Agreement::UserRoles';
137 }
138
139 1;