View | Details | Raw Unified | Return to bug 24857
Collapse All | Expand All

(-)a/Koha/Schema/Result/Biblio.pm (-2 / +17 lines)
Lines 315-320 __PACKAGE__->has_many( Link Here
315
  { cascade_copy => 0, cascade_delete => 0 },
315
  { cascade_copy => 0, cascade_delete => 0 },
316
);
316
);
317
317
318
=head2 item_groups
319
320
Type: has_many
321
322
Related object: L<Koha::Schema::Result::ItemGroup>
323
324
=cut
325
326
__PACKAGE__->has_many(
327
  "item_groups",
328
  "Koha::Schema::Result::ItemGroup",
329
  { "foreign.biblio_id" => "self.biblionumber" },
330
  { cascade_copy => 0, cascade_delete => 0 },
331
);
332
318
=head2 items
333
=head2 items
319
334
320
Type: has_many
335
Type: has_many
Lines 526-533 __PACKAGE__->has_many( Link Here
526
);
541
);
527
542
528
543
529
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-09-20 12:00:15
544
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2022-03-07 15:59:20
530
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:troBZEbpX+2RhgH2jptVZQ
545
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:m1QMpWvK/E2MXuZXs4jHoQ
531
546
532
__PACKAGE__->has_many(
547
__PACKAGE__->has_many(
533
  "biblioitem",
548
  "biblioitem",
(-)a/Koha/Schema/Result/Item.pm (-2 / +17 lines)
Lines 729-734 __PACKAGE__->might_have( Link Here
729
  { cascade_copy => 0, cascade_delete => 0 },
729
  { cascade_copy => 0, cascade_delete => 0 },
730
);
730
);
731
731
732
=head2 item_group_item
733
734
Type: might_have
735
736
Related object: L<Koha::Schema::Result::ItemGroupItem>
737
738
=cut
739
740
__PACKAGE__->might_have(
741
  "item_group_item",
742
  "Koha::Schema::Result::ItemGroupItem",
743
  { "foreign.item_id" => "self.itemnumber" },
744
  { cascade_copy => 0, cascade_delete => 0 },
745
);
746
732
=head2 items_last_borrower
747
=head2 items_last_borrower
733
748
734
Type: might_have
749
Type: might_have
Lines 865-872 __PACKAGE__->has_many( Link Here
865
);
880
);
866
881
867
882
868
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-08-27 08:42:21
883
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-09-01 12:52:33
869
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:SjZn3haOtUZWu1jrMigjNQ
884
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:WeRY0B6a1D94WckYmUgWpQ
870
885
871
__PACKAGE__->belongs_to( biblioitem => "Koha::Schema::Result::Biblioitem", "biblioitemnumber" );
886
__PACKAGE__->belongs_to( biblioitem => "Koha::Schema::Result::Biblioitem", "biblioitemnumber" );
872
887
(-)a/Koha/Schema/Result/ItemGroup.pm (+161 lines)
Line 0 Link Here
1
use utf8;
2
package Koha::Schema::Result::ItemGroup;
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::ItemGroup
10
11
=cut
12
13
use strict;
14
use warnings;
15
16
use base 'DBIx::Class::Core';
17
18
=head1 TABLE: C<item_groups>
19
20
=cut
21
22
__PACKAGE__->table("item_groups");
23
24
=head1 ACCESSORS
25
26
=head2 item_group_id
27
28
  data_type: 'integer'
29
  is_auto_increment: 1
30
  is_nullable: 0
31
32
id for the items group
33
34
=head2 biblio_id
35
36
  data_type: 'integer'
37
  default_value: 0
38
  is_foreign_key: 1
39
  is_nullable: 0
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
51
=head2 description
52
53
  data_type: 'mediumtext'
54
  is_nullable: 1
55
56
A group description
57
58
=head2 created_on
59
60
  data_type: 'timestamp'
61
  datetime_undef_if_invalid: 1
62
  is_nullable: 1
63
64
Time and date the group was created
65
66
=head2 updated_on
67
68
  data_type: 'timestamp'
69
  datetime_undef_if_invalid: 1
70
  default_value: current_timestamp
71
  is_nullable: 0
72
73
Time and date of the latest change on the group
74
75
=cut
76
77
__PACKAGE__->add_columns(
78
  "item_group_id",
79
  { data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
80
  "biblio_id",
81
  {
82
    data_type      => "integer",
83
    default_value  => 0,
84
    is_foreign_key => 1,
85
    is_nullable    => 0,
86
  },
87
  "display_order",
88
  { data_type => "integer", default_value => 0, is_nullable => 0 },
89
  "description",
90
  { data_type => "mediumtext", is_nullable => 1 },
91
  "created_on",
92
  {
93
    data_type => "timestamp",
94
    datetime_undef_if_invalid => 1,
95
    is_nullable => 1,
96
  },
97
  "updated_on",
98
  {
99
    data_type => "timestamp",
100
    datetime_undef_if_invalid => 1,
101
    default_value => \"current_timestamp",
102
    is_nullable => 0,
103
  },
104
);
105
106
=head1 PRIMARY KEY
107
108
=over 4
109
110
=item * L</item_group_id>
111
112
=back
113
114
=cut
115
116
__PACKAGE__->set_primary_key("item_group_id");
117
118
=head1 RELATIONS
119
120
=head2 biblio
121
122
Type: belongs_to
123
124
Related object: L<Koha::Schema::Result::Biblio>
125
126
=cut
127
128
__PACKAGE__->belongs_to(
129
  "biblio",
130
  "Koha::Schema::Result::Biblio",
131
  { biblionumber => "biblio_id" },
132
  { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
133
);
134
135
=head2 item_group_items
136
137
Type: has_many
138
139
Related object: L<Koha::Schema::Result::ItemGroupItem>
140
141
=cut
142
143
__PACKAGE__->has_many(
144
  "item_group_items",
145
  "Koha::Schema::Result::ItemGroupItem",
146
  { "foreign.item_group_id" => "self.item_group_id" },
147
  { cascade_copy => 0, cascade_delete => 0 },
148
);
149
150
151
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-09-01 12:37:33
152
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:uB7PHJt6WQHMv/saTCpkOw
153
154
sub koha_object_class {
155
    'Koha::Biblio::ItemGroup';
156
}
157
sub koha_objects_class {
158
    'Koha::Biblio::ItemGroups';
159
}
160
161
1;
(-)a/Koha/Schema/Result/ItemGroupItem.pm (-1 / +142 lines)
Line 0 Link Here
0
- 
1
use utf8;
2
package Koha::Schema::Result::ItemGroupItem;
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::ItemGroupItem
10
11
=cut
12
13
use strict;
14
use warnings;
15
16
use base 'DBIx::Class::Core';
17
18
=head1 TABLE: C<item_group_items>
19
20
=cut
21
22
__PACKAGE__->table("item_group_items");
23
24
=head1 ACCESSORS
25
26
=head2 item_group_items_id
27
28
  data_type: 'integer'
29
  is_auto_increment: 1
30
  is_nullable: 0
31
32
id for the group/item link
33
34
=head2 item_group_id
35
36
  data_type: 'integer'
37
  default_value: 0
38
  is_foreign_key: 1
39
  is_nullable: 0
40
41
foreign key making this table a 1 to 1 join from items to item groups
42
43
=head2 item_id
44
45
  data_type: 'integer'
46
  default_value: 0
47
  is_foreign_key: 1
48
  is_nullable: 0
49
50
foreign key linking this table to the items table
51
52
=cut
53
54
__PACKAGE__->add_columns(
55
  "item_group_items_id",
56
  { data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
57
  "item_group_id",
58
  {
59
    data_type      => "integer",
60
    default_value  => 0,
61
    is_foreign_key => 1,
62
    is_nullable    => 0,
63
  },
64
  "item_id",
65
  {
66
    data_type      => "integer",
67
    default_value  => 0,
68
    is_foreign_key => 1,
69
    is_nullable    => 0,
70
  },
71
);
72
73
=head1 PRIMARY KEY
74
75
=over 4
76
77
=item * L</item_group_items_id>
78
79
=back
80
81
=cut
82
83
__PACKAGE__->set_primary_key("item_group_items_id");
84
85
=head1 UNIQUE CONSTRAINTS
86
87
=head2 C<item_id>
88
89
=over 4
90
91
=item * L</item_id>
92
93
=back
94
95
=cut
96
97
__PACKAGE__->add_unique_constraint("item_id", ["item_id"]);
98
99
=head1 RELATIONS
100
101
=head2 item
102
103
Type: belongs_to
104
105
Related object: L<Koha::Schema::Result::Item>
106
107
=cut
108
109
__PACKAGE__->belongs_to(
110
  "item",
111
  "Koha::Schema::Result::Item",
112
  { itemnumber => "item_id" },
113
  { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
114
);
115
116
=head2 item_group
117
118
Type: belongs_to
119
120
Related object: L<Koha::Schema::Result::ItemGroup>
121
122
=cut
123
124
__PACKAGE__->belongs_to(
125
  "item_group",
126
  "Koha::Schema::Result::ItemGroup",
127
  { item_group_id => "item_group_id" },
128
  { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
129
);
130
131
132
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-09-01 12:52:33
133
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:y9cE5sPmUxcJFgAZfsEQsg
134
135
sub koha_object_class {
136
    'Koha::Biblio::ItemGroup::Item';
137
}
138
sub koha_objects_class {
139
    'Koha::Biblio::ItemGroup::Items';
140
}
141
142
1;

Return to bug 24857