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

(-)a/Koha/Schema/Result/Volume.pm (+144 lines)
Line 0 Link Here
1
use utf8;
2
package Koha::Schema::Result::Volume;
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::Volume
10
11
=cut
12
13
use strict;
14
use warnings;
15
16
use base 'DBIx::Class::Core';
17
18
=head1 TABLE: C<volumes>
19
20
=cut
21
22
__PACKAGE__->table("volumes");
23
24
=head1 ACCESSORS
25
26
=head2 id
27
28
  data_type: 'integer'
29
  is_auto_increment: 1
30
  is_nullable: 0
31
32
=head2 biblionumber
33
34
  data_type: 'integer'
35
  default_value: 0
36
  is_foreign_key: 1
37
  is_nullable: 0
38
39
=head2 description
40
41
  data_type: 'mediumtext'
42
  is_nullable: 1
43
44
=head2 created_on
45
46
  data_type: 'timestamp'
47
  datetime_undef_if_invalid: 1
48
  default_value: '0000-00-00 00:00:00'
49
  is_nullable: 0
50
51
=head2 updated_on
52
53
  data_type: 'timestamp'
54
  datetime_undef_if_invalid: 1
55
  default_value: current_timestamp
56
  is_nullable: 0
57
58
=cut
59
60
__PACKAGE__->add_columns(
61
  "id",
62
  { data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
63
  "biblionumber",
64
  {
65
    data_type      => "integer",
66
    default_value  => 0,
67
    is_foreign_key => 1,
68
    is_nullable    => 0,
69
  },
70
  "description",
71
  { data_type => "mediumtext", is_nullable => 1 },
72
  "created_on",
73
  {
74
    data_type => "timestamp",
75
    datetime_undef_if_invalid => 1,
76
    default_value => "0000-00-00 00:00:00",
77
    is_nullable => 0,
78
  },
79
  "updated_on",
80
  {
81
    data_type => "timestamp",
82
    datetime_undef_if_invalid => 1,
83
    default_value => \"current_timestamp",
84
    is_nullable => 0,
85
  },
86
);
87
88
=head1 PRIMARY KEY
89
90
=over 4
91
92
=item * L</id>
93
94
=back
95
96
=cut
97
98
__PACKAGE__->set_primary_key("id");
99
100
=head1 RELATIONS
101
102
=head2 biblionumber
103
104
Type: belongs_to
105
106
Related object: L<Koha::Schema::Result::Biblio>
107
108
=cut
109
110
__PACKAGE__->belongs_to(
111
  "biblionumber",
112
  "Koha::Schema::Result::Biblio",
113
  { biblionumber => "biblionumber" },
114
  { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
115
);
116
117
=head2 volume_items
118
119
Type: has_many
120
121
Related object: L<Koha::Schema::Result::VolumeItem>
122
123
=cut
124
125
__PACKAGE__->has_many(
126
  "volume_items",
127
  "Koha::Schema::Result::VolumeItem",
128
  { "foreign.volume_id" => "self.id" },
129
  { cascade_copy => 0, cascade_delete => 0 },
130
);
131
132
133
# Created by DBIx::Class::Schema::Loader v0.07046 @ 2020-02-04 15:22:18
134
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:cXvLM2TgY18pxE2ZJBMouw
135
136
sub koha_objects_class {
137
    'Koha::Biblio::Volumes';
138
}
139
140
sub koha_object_class {
141
    'Koha::Biblio::Volume';
142
}
143
144
1;
(-)a/Koha/Schema/Result/VolumeItem.pm (-1 / +122 lines)
Line 0 Link Here
0
- 
1
use utf8;
2
package Koha::Schema::Result::VolumeItem;
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::VolumeItem
10
11
=cut
12
13
use strict;
14
use warnings;
15
16
use base 'DBIx::Class::Core';
17
18
=head1 TABLE: C<volume_items>
19
20
=cut
21
22
__PACKAGE__->table("volume_items");
23
24
=head1 ACCESSORS
25
26
=head2 id
27
28
  data_type: 'integer'
29
  is_auto_increment: 1
30
  is_nullable: 0
31
32
=head2 volume_id
33
34
  data_type: 'integer'
35
  default_value: 0
36
  is_foreign_key: 1
37
  is_nullable: 0
38
39
=head2 itemnumber
40
41
  data_type: 'integer'
42
  default_value: 0
43
  is_foreign_key: 1
44
  is_nullable: 0
45
46
=cut
47
48
__PACKAGE__->add_columns(
49
  "id",
50
  { data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
51
  "volume_id",
52
  {
53
    data_type      => "integer",
54
    default_value  => 0,
55
    is_foreign_key => 1,
56
    is_nullable    => 0,
57
  },
58
  "itemnumber",
59
  {
60
    data_type      => "integer",
61
    default_value  => 0,
62
    is_foreign_key => 1,
63
    is_nullable    => 0,
64
  },
65
);
66
67
=head1 PRIMARY KEY
68
69
=over 4
70
71
=item * L</id>
72
73
=back
74
75
=cut
76
77
__PACKAGE__->set_primary_key("id");
78
79
=head1 RELATIONS
80
81
=head2 itemnumber
82
83
Type: belongs_to
84
85
Related object: L<Koha::Schema::Result::Item>
86
87
=cut
88
89
__PACKAGE__->belongs_to(
90
  "itemnumber",
91
  "Koha::Schema::Result::Item",
92
  { itemnumber => "itemnumber" },
93
  { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
94
);
95
96
=head2 volume
97
98
Type: belongs_to
99
100
Related object: L<Koha::Schema::Result::Volume>
101
102
=cut
103
104
__PACKAGE__->belongs_to(
105
  "volume",
106
  "Koha::Schema::Result::Volume",
107
  { id => "volume_id" },
108
  { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
109
);
110
111
112
# Created by DBIx::Class::Schema::Loader v0.07046 @ 2020-02-03 18:25:20
113
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:i6YHB4Jq+79kVVYmuurzIQ
114
115
sub koha_object_class {
116
    'Koha::Biblio::Volume::Item';
117
}
118
sub koha_objects_class {
119
    'Koha::Biblio::Volume::Items';
120
}
121
122
1;

Return to bug 24857