Lines 1-12
Link Here
|
1 |
use utf8; |
1 |
use utf8; |
2 |
package Koha::Schema::Result::Volume; |
2 |
package Koha::Schema::Result::ItemGroup; |
3 |
|
3 |
|
4 |
# Created by DBIx::Class::Schema::Loader |
4 |
# Created by DBIx::Class::Schema::Loader |
5 |
# DO NOT MODIFY THE FIRST PART OF THIS FILE |
5 |
# DO NOT MODIFY THE FIRST PART OF THIS FILE |
6 |
|
6 |
|
7 |
=head1 NAME |
7 |
=head1 NAME |
8 |
|
8 |
|
9 |
Koha::Schema::Result::Volume |
9 |
Koha::Schema::Result::ItemGroup |
10 |
|
10 |
|
11 |
=cut |
11 |
=cut |
12 |
|
12 |
|
Lines 15-52
use warnings;
Link Here
|
15 |
|
15 |
|
16 |
use base 'DBIx::Class::Core'; |
16 |
use base 'DBIx::Class::Core'; |
17 |
|
17 |
|
18 |
=head1 TABLE: C<volumes> |
18 |
=head1 TABLE: C<item_groups> |
19 |
|
19 |
|
20 |
=cut |
20 |
=cut |
21 |
|
21 |
|
22 |
__PACKAGE__->table("volumes"); |
22 |
__PACKAGE__->table("item_groups"); |
23 |
|
23 |
|
24 |
=head1 ACCESSORS |
24 |
=head1 ACCESSORS |
25 |
|
25 |
|
26 |
=head2 id |
26 |
=head2 item_group_id |
27 |
|
27 |
|
28 |
data_type: 'integer' |
28 |
data_type: 'integer' |
29 |
is_auto_increment: 1 |
29 |
is_auto_increment: 1 |
30 |
is_nullable: 0 |
30 |
is_nullable: 0 |
31 |
|
31 |
|
32 |
=head2 biblionumber |
32 |
id for the items group |
|
|
33 |
|
34 |
=head2 biblio_id |
33 |
|
35 |
|
34 |
data_type: 'integer' |
36 |
data_type: 'integer' |
35 |
default_value: 0 |
37 |
default_value: 0 |
36 |
is_foreign_key: 1 |
38 |
is_foreign_key: 1 |
37 |
is_nullable: 0 |
39 |
is_nullable: 0 |
38 |
|
40 |
|
|
|
41 |
id for the bibliographic record the group belongs to |
42 |
|
43 |
=head2 display_order |
44 |
|
45 |
data_type: 'integer' |
46 |
default_value: 0 |
47 |
is_nullable: 0 |
48 |
|
49 |
The 'sort order' for item_groups |
50 |
|
39 |
=head2 description |
51 |
=head2 description |
40 |
|
52 |
|
41 |
data_type: 'mediumtext' |
53 |
data_type: 'mediumtext' |
42 |
is_nullable: 1 |
54 |
is_nullable: 1 |
43 |
|
55 |
|
|
|
56 |
A group description |
57 |
|
44 |
=head2 created_on |
58 |
=head2 created_on |
45 |
|
59 |
|
46 |
data_type: 'timestamp' |
60 |
data_type: 'timestamp' |
47 |
datetime_undef_if_invalid: 1 |
61 |
datetime_undef_if_invalid: 1 |
48 |
default_value: '0000-00-00 00:00:00' |
62 |
is_nullable: 1 |
49 |
is_nullable: 0 |
63 |
|
|
|
64 |
Time and date the group was created |
50 |
|
65 |
|
51 |
=head2 updated_on |
66 |
=head2 updated_on |
52 |
|
67 |
|
Lines 55-80
__PACKAGE__->table("volumes");
Link Here
|
55 |
default_value: current_timestamp |
70 |
default_value: current_timestamp |
56 |
is_nullable: 0 |
71 |
is_nullable: 0 |
57 |
|
72 |
|
|
|
73 |
Time and date of the latest change on the group |
74 |
|
58 |
=cut |
75 |
=cut |
59 |
|
76 |
|
60 |
__PACKAGE__->add_columns( |
77 |
__PACKAGE__->add_columns( |
61 |
"id", |
78 |
"item_group_id", |
62 |
{ data_type => "integer", is_auto_increment => 1, is_nullable => 0 }, |
79 |
{ data_type => "integer", is_auto_increment => 1, is_nullable => 0 }, |
63 |
"biblionumber", |
80 |
"biblio_id", |
64 |
{ |
81 |
{ |
65 |
data_type => "integer", |
82 |
data_type => "integer", |
66 |
default_value => 0, |
83 |
default_value => 0, |
67 |
is_foreign_key => 1, |
84 |
is_foreign_key => 1, |
68 |
is_nullable => 0, |
85 |
is_nullable => 0, |
69 |
}, |
86 |
}, |
|
|
87 |
"display_order", |
88 |
{ data_type => "integer", default_value => 0, is_nullable => 0 }, |
70 |
"description", |
89 |
"description", |
71 |
{ data_type => "mediumtext", is_nullable => 1 }, |
90 |
{ data_type => "mediumtext", is_nullable => 1 }, |
72 |
"created_on", |
91 |
"created_on", |
73 |
{ |
92 |
{ |
74 |
data_type => "timestamp", |
93 |
data_type => "timestamp", |
75 |
datetime_undef_if_invalid => 1, |
94 |
datetime_undef_if_invalid => 1, |
76 |
default_value => "0000-00-00 00:00:00", |
95 |
is_nullable => 1, |
77 |
is_nullable => 0, |
|
|
78 |
}, |
96 |
}, |
79 |
"updated_on", |
97 |
"updated_on", |
80 |
{ |
98 |
{ |
Lines 89-105
__PACKAGE__->add_columns(
Link Here
|
89 |
|
107 |
|
90 |
=over 4 |
108 |
=over 4 |
91 |
|
109 |
|
92 |
=item * L</id> |
110 |
=item * L</item_group_id> |
93 |
|
111 |
|
94 |
=back |
112 |
=back |
95 |
|
113 |
|
96 |
=cut |
114 |
=cut |
97 |
|
115 |
|
98 |
__PACKAGE__->set_primary_key("id"); |
116 |
__PACKAGE__->set_primary_key("item_group_id"); |
99 |
|
117 |
|
100 |
=head1 RELATIONS |
118 |
=head1 RELATIONS |
101 |
|
119 |
|
102 |
=head2 biblionumber |
120 |
=head2 biblio |
103 |
|
121 |
|
104 |
Type: belongs_to |
122 |
Type: belongs_to |
105 |
|
123 |
|
Lines 108-137
Related object: L<Koha::Schema::Result::Biblio>
Link Here
|
108 |
=cut |
126 |
=cut |
109 |
|
127 |
|
110 |
__PACKAGE__->belongs_to( |
128 |
__PACKAGE__->belongs_to( |
111 |
"biblionumber", |
129 |
"biblio", |
112 |
"Koha::Schema::Result::Biblio", |
130 |
"Koha::Schema::Result::Biblio", |
113 |
{ biblionumber => "biblionumber" }, |
131 |
{ biblionumber => "biblio_id" }, |
114 |
{ is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }, |
132 |
{ is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }, |
115 |
); |
133 |
); |
116 |
|
134 |
|
117 |
=head2 volume_items |
135 |
=head2 item_group_items |
118 |
|
136 |
|
119 |
Type: has_many |
137 |
Type: has_many |
120 |
|
138 |
|
121 |
Related object: L<Koha::Schema::Result::VolumeItem> |
139 |
Related object: L<Koha::Schema::Result::ItemGroupItem> |
122 |
|
140 |
|
123 |
=cut |
141 |
=cut |
124 |
|
142 |
|
125 |
__PACKAGE__->has_many( |
143 |
__PACKAGE__->has_many( |
126 |
"volume_items", |
144 |
"item_group_items", |
127 |
"Koha::Schema::Result::VolumeItem", |
145 |
"Koha::Schema::Result::ItemGroupItem", |
128 |
{ "foreign.volume_id" => "self.id" }, |
146 |
{ "foreign.item_group_id" => "self.item_group_id" }, |
129 |
{ cascade_copy => 0, cascade_delete => 0 }, |
147 |
{ cascade_copy => 0, cascade_delete => 0 }, |
130 |
); |
148 |
); |
131 |
|
149 |
|
132 |
|
150 |
|
133 |
# Created by DBIx::Class::Schema::Loader v0.07046 @ 2020-02-04 15:22:18 |
151 |
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-09-01 12:37:33 |
134 |
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:cXvLM2TgY18pxE2ZJBMouw |
152 |
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:uB7PHJt6WQHMv/saTCpkOw |
135 |
|
153 |
|
136 |
=head2 koha_objects_class |
154 |
=head2 koha_objects_class |
137 |
|
155 |
|
Lines 144-152
sub koha_objects_class {
Link Here
|
144 |
=head2 koha_object_class |
162 |
=head2 koha_object_class |
145 |
|
163 |
|
146 |
=cut |
164 |
=cut |
|
|
165 |
======= |
166 |
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-08-18 14:00:35 |
167 |
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:1WBTrtEB25MCOwR4nqPpVA |
168 |
>>>>>>> Bug 24857: Rename Volumes => Item groups (DB):Koha/Schema/Result/ItemGroup.pm |
147 |
|
169 |
|
148 |
sub koha_object_class { |
|
|
149 |
'Koha::Biblio::Volume'; |
150 |
} |
151 |
|
170 |
|
|
|
171 |
# You can replace this text with custom code or comments, and it will be preserved on regeneration |
152 |
1; |
172 |
1; |