Bug 32030: DBIC Specific
[koha.git] / Koha / Schema / Result / ErmLicense.pm
1 use utf8;
2 package Koha::Schema::Result::ErmLicense;
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::ErmLicense
10
11 =cut
12
13 use strict;
14 use warnings;
15
16 use base 'DBIx::Class::Core';
17
18 =head1 TABLE: C<erm_licenses>
19
20 =cut
21
22 __PACKAGE__->table("erm_licenses");
23
24 =head1 ACCESSORS
25
26 =head2 license_id
27
28   data_type: 'integer'
29   is_auto_increment: 1
30   is_nullable: 0
31
32 primary key
33
34 =head2 vendor_id
35
36   data_type: 'integer'
37   is_foreign_key: 1
38   is_nullable: 1
39
40 foreign key to aqbooksellers
41
42 =head2 name
43
44   data_type: 'varchar'
45   is_nullable: 0
46   size: 255
47
48 name of the license
49
50 =head2 description
51
52   data_type: 'longtext'
53   is_nullable: 1
54
55 description of the license
56
57 =head2 type
58
59   data_type: 'varchar'
60   is_nullable: 0
61   size: 80
62
63 type of the license
64
65 =head2 status
66
67   data_type: 'varchar'
68   is_nullable: 0
69   size: 80
70
71 current status of the license
72
73 =head2 started_on
74
75   data_type: 'date'
76   datetime_undef_if_invalid: 1
77   is_nullable: 1
78
79 start of the license
80
81 =head2 ended_on
82
83   data_type: 'date'
84   datetime_undef_if_invalid: 1
85   is_nullable: 1
86
87 end of the license
88
89 =cut
90
91 __PACKAGE__->add_columns(
92   "license_id",
93   { data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
94   "vendor_id",
95   { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
96   "name",
97   { data_type => "varchar", is_nullable => 0, size => 255 },
98   "description",
99   { data_type => "longtext", is_nullable => 1 },
100   "type",
101   { data_type => "varchar", is_nullable => 0, size => 80 },
102   "status",
103   { data_type => "varchar", is_nullable => 0, size => 80 },
104   "started_on",
105   { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
106   "ended_on",
107   { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
108 );
109
110 =head1 PRIMARY KEY
111
112 =over 4
113
114 =item * L</license_id>
115
116 =back
117
118 =cut
119
120 __PACKAGE__->set_primary_key("license_id");
121
122 =head1 RELATIONS
123
124 =head2 erm_agreement_licenses
125
126 Type: has_many
127
128 Related object: L<Koha::Schema::Result::ErmAgreementLicense>
129
130 =cut
131
132 __PACKAGE__->has_many(
133   "erm_agreement_licenses",
134   "Koha::Schema::Result::ErmAgreementLicense",
135   { "foreign.license_id" => "self.license_id" },
136   { cascade_copy => 0, cascade_delete => 0 },
137 );
138
139 =head2 erm_documents
140
141 Type: has_many
142
143 Related object: L<Koha::Schema::Result::ErmDocument>
144
145 =cut
146
147 __PACKAGE__->has_many(
148   "erm_documents",
149   "Koha::Schema::Result::ErmDocument",
150   { "foreign.license_id" => "self.license_id" },
151   { cascade_copy => 0, cascade_delete => 0 },
152 );
153
154 =head2 erm_user_roles
155
156 Type: has_many
157
158 Related object: L<Koha::Schema::Result::ErmUserRole>
159
160 =cut
161
162 __PACKAGE__->has_many(
163   "erm_user_roles",
164   "Koha::Schema::Result::ErmUserRole",
165   { "foreign.license_id" => "self.license_id" },
166   { cascade_copy => 0, cascade_delete => 0 },
167 );
168
169 =head2 vendor
170
171 Type: belongs_to
172
173 Related object: L<Koha::Schema::Result::Aqbookseller>
174
175 =cut
176
177 __PACKAGE__->belongs_to(
178   "vendor",
179   "Koha::Schema::Result::Aqbookseller",
180   { id => "vendor_id" },
181   {
182     is_deferrable => 1,
183     join_type     => "LEFT",
184     on_delete     => "SET NULL",
185     on_update     => "CASCADE",
186   },
187 );
188
189
190 # Created by DBIx::Class::Schema::Loader v0.07049 @ 2022-11-01 07:44:13
191 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Fs4bmI/N6Cvicv3RW2qwXQ
192
193 sub koha_object_class {
194     'Koha::ERM::License';
195 }
196 sub koha_objects_class {
197     'Koha::ERM::Licenses';
198 }
199
200 1;