Line 0
Link Here
|
|
|
1 |
use utf8; |
2 |
package Koha::Schema::Result::Booking; |
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::Booking |
10 |
|
11 |
=cut |
12 |
|
13 |
use strict; |
14 |
use warnings; |
15 |
|
16 |
use base 'DBIx::Class::Core'; |
17 |
|
18 |
=head1 TABLE: C<bookings> |
19 |
|
20 |
=cut |
21 |
|
22 |
__PACKAGE__->table("bookings"); |
23 |
|
24 |
=head1 ACCESSORS |
25 |
|
26 |
=head2 booking_id |
27 |
|
28 |
data_type: 'integer' |
29 |
is_auto_increment: 1 |
30 |
is_nullable: 0 |
31 |
|
32 |
primary key |
33 |
|
34 |
=head2 borrowernumber |
35 |
|
36 |
data_type: 'integer' |
37 |
default_value: 0 |
38 |
is_foreign_key: 1 |
39 |
is_nullable: 0 |
40 |
|
41 |
foreign key from the borrowers table defining which patron this booking is for |
42 |
|
43 |
=head2 biblionumber |
44 |
|
45 |
data_type: 'integer' |
46 |
default_value: 0 |
47 |
is_foreign_key: 1 |
48 |
is_nullable: 0 |
49 |
|
50 |
foreign key from the biblio table defining which bib record this booking is on |
51 |
|
52 |
=head2 itemnumber |
53 |
|
54 |
data_type: 'integer' |
55 |
is_foreign_key: 1 |
56 |
is_nullable: 1 |
57 |
|
58 |
foreign key from the items table defining the specific item the patron has placed a booking for |
59 |
|
60 |
=head2 start_date |
61 |
|
62 |
data_type: 'datetime' |
63 |
datetime_undef_if_invalid: 1 |
64 |
is_nullable: 1 |
65 |
|
66 |
the start date of the booking |
67 |
|
68 |
=head2 end_date |
69 |
|
70 |
data_type: 'datetime' |
71 |
datetime_undef_if_invalid: 1 |
72 |
is_nullable: 1 |
73 |
|
74 |
the end date of the booking |
75 |
|
76 |
=cut |
77 |
|
78 |
__PACKAGE__->add_columns( |
79 |
"booking_id", |
80 |
{ data_type => "integer", is_auto_increment => 1, is_nullable => 0 }, |
81 |
"borrowernumber", |
82 |
{ |
83 |
data_type => "integer", |
84 |
default_value => 0, |
85 |
is_foreign_key => 1, |
86 |
is_nullable => 0, |
87 |
}, |
88 |
"biblionumber", |
89 |
{ |
90 |
data_type => "integer", |
91 |
default_value => 0, |
92 |
is_foreign_key => 1, |
93 |
is_nullable => 0, |
94 |
}, |
95 |
"itemnumber", |
96 |
{ data_type => "integer", is_foreign_key => 1, is_nullable => 1 }, |
97 |
"start_date", |
98 |
{ |
99 |
data_type => "datetime", |
100 |
datetime_undef_if_invalid => 1, |
101 |
is_nullable => 1, |
102 |
}, |
103 |
"end_date", |
104 |
{ |
105 |
data_type => "datetime", |
106 |
datetime_undef_if_invalid => 1, |
107 |
is_nullable => 1, |
108 |
}, |
109 |
); |
110 |
|
111 |
=head1 PRIMARY KEY |
112 |
|
113 |
=over 4 |
114 |
|
115 |
=item * L</booking_id> |
116 |
|
117 |
=back |
118 |
|
119 |
=cut |
120 |
|
121 |
__PACKAGE__->set_primary_key("booking_id"); |
122 |
|
123 |
=head1 RELATIONS |
124 |
|
125 |
=head2 biblionumber |
126 |
|
127 |
Type: belongs_to |
128 |
|
129 |
Related object: L<Koha::Schema::Result::Biblio> |
130 |
|
131 |
=cut |
132 |
|
133 |
__PACKAGE__->belongs_to( |
134 |
"biblionumber", |
135 |
"Koha::Schema::Result::Biblio", |
136 |
{ biblionumber => "biblionumber" }, |
137 |
{ is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }, |
138 |
); |
139 |
|
140 |
=head2 borrowernumber |
141 |
|
142 |
Type: belongs_to |
143 |
|
144 |
Related object: L<Koha::Schema::Result::Borrower> |
145 |
|
146 |
=cut |
147 |
|
148 |
__PACKAGE__->belongs_to( |
149 |
"borrowernumber", |
150 |
"Koha::Schema::Result::Borrower", |
151 |
{ borrowernumber => "borrowernumber" }, |
152 |
{ is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }, |
153 |
); |
154 |
|
155 |
=head2 itemnumber |
156 |
|
157 |
Type: belongs_to |
158 |
|
159 |
Related object: L<Koha::Schema::Result::Item> |
160 |
|
161 |
=cut |
162 |
|
163 |
__PACKAGE__->belongs_to( |
164 |
"itemnumber", |
165 |
"Koha::Schema::Result::Item", |
166 |
{ itemnumber => "itemnumber" }, |
167 |
{ |
168 |
is_deferrable => 1, |
169 |
join_type => "LEFT", |
170 |
on_delete => "CASCADE", |
171 |
on_update => "CASCADE", |
172 |
}, |
173 |
); |
174 |
|
175 |
|
176 |
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-09-15 15:26:37 |
177 |
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:1M7/k3YWVzO2kH517vNNtg |
178 |
|
179 |
|
180 |
# You can replace this text with custom code or comments, and it will be preserved on regeneration |
181 |
1; |