2 package Koha::Schema::Result::Reserve;
4 # Created by DBIx::Class::Schema::Loader
5 # DO NOT MODIFY THE FIRST PART OF THIS FILE
9 Koha::Schema::Result::Reserve
16 use base 'DBIx::Class::Core';
18 =head1 TABLE: C<reserves>
22 __PACKAGE__->table("reserves");
41 foreign key from the borrowers table defining which patron this hold is for
46 datetime_undef_if_invalid: 1
49 the date the hold was placed
58 foreign key from the biblio table defining which bib record this hold is on
67 foreign key from the branches table defining which branch the patron wishes to pick this hold up at
75 foreign key from the desks table defining which desk the patron should pick this hold up at
77 =head2 notificationdate
80 datetime_undef_if_invalid: 1
88 datetime_undef_if_invalid: 1
93 =head2 cancellationdate
96 datetime_undef_if_invalid: 1
99 the date this hold was cancelled
101 =head2 cancellation_reason
107 optional authorised value CANCELLATION_REASON
111 data_type: 'longtext'
114 notes related to this hold
118 data_type: 'smallint'
122 where in the queue the patron sits
130 a one letter code defining what the status is of the hold is after it has been confirmed
134 data_type: 'timestamp'
135 datetime_undef_if_invalid: 1
136 default_value: current_timestamp
139 the date and time this hold was last updated
147 foreign key from the items table defining the specific item the patron has placed on hold or the item this hold was filled with
152 datetime_undef_if_invalid: 1
155 the date the item was marked as waiting for the patron at the library
157 =head2 expirationdate
160 datetime_undef_if_invalid: 1
163 the date the hold expires (usually the date entered by the patron to say they don't need the hold after a certain date)
165 =head2 lowestPriority
167 accessor: 'lowest_priority'
180 data_type: 'datetime'
181 datetime_undef_if_invalid: 1
191 If record level hold, the optional itemtype of the item the patron is requesting
193 =head2 item_level_hold
199 Is the hpld placed at item level
207 Is this a non priority hold
211 __PACKAGE__->add_columns(
213 { data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
216 data_type => "integer",
222 { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
225 data_type => "integer",
231 { data_type => "varchar", is_foreign_key => 1, is_nullable => 0, size => 10 },
233 { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
235 { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
237 { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
239 { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
240 "cancellation_reason",
241 { data_type => "varchar", is_nullable => 1, size => 80 },
243 { data_type => "longtext", is_nullable => 1 },
245 { data_type => "smallint", default_value => 1, is_nullable => 0 },
247 { data_type => "varchar", is_nullable => 1, size => 1 },
250 data_type => "timestamp",
251 datetime_undef_if_invalid => 1,
252 default_value => \"current_timestamp",
256 { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
258 { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
260 { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
263 accessor => "lowest_priority",
264 data_type => "tinyint",
269 { data_type => "tinyint", default_value => 0, is_nullable => 0 },
272 data_type => "datetime",
273 datetime_undef_if_invalid => 1,
277 { data_type => "varchar", is_foreign_key => 1, is_nullable => 1, size => 10 },
279 { data_type => "tinyint", default_value => 0, is_nullable => 0 },
281 { data_type => "tinyint", default_value => 0, is_nullable => 0 },
288 =item * L</reserve_id>
294 __PACKAGE__->set_primary_key("reserve_id");
302 Related object: L<Koha::Schema::Result::Biblio>
306 __PACKAGE__->belongs_to(
308 "Koha::Schema::Result::Biblio",
309 { biblionumber => "biblionumber" },
310 { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
313 =head2 borrowernumber
317 Related object: L<Koha::Schema::Result::Borrower>
321 __PACKAGE__->belongs_to(
323 "Koha::Schema::Result::Borrower",
324 { borrowernumber => "borrowernumber" },
325 { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
332 Related object: L<Koha::Schema::Result::Branch>
336 __PACKAGE__->belongs_to(
338 "Koha::Schema::Result::Branch",
339 { branchcode => "branchcode" },
340 { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
343 =head2 club_holds_to_patron_holds
347 Related object: L<Koha::Schema::Result::ClubHoldsToPatronHold>
351 __PACKAGE__->has_many(
352 "club_holds_to_patron_holds",
353 "Koha::Schema::Result::ClubHoldsToPatronHold",
354 { "foreign.hold_id" => "self.reserve_id" },
355 { cascade_copy => 0, cascade_delete => 0 },
362 Related object: L<Koha::Schema::Result::Desk>
366 __PACKAGE__->belongs_to(
368 "Koha::Schema::Result::Desk",
369 { desk_id => "desk_id" },
373 on_delete => "SET NULL",
374 on_update => "CASCADE",
382 Related object: L<Koha::Schema::Result::Item>
386 __PACKAGE__->belongs_to(
388 "Koha::Schema::Result::Item",
389 { itemnumber => "itemnumber" },
393 on_delete => "CASCADE",
394 on_update => "CASCADE",
402 Related object: L<Koha::Schema::Result::Itemtype>
406 __PACKAGE__->belongs_to(
408 "Koha::Schema::Result::Itemtype",
409 { itemtype => "itemtype" },
413 on_delete => "CASCADE",
414 on_update => "CASCADE",
419 # Created by DBIx::Class::Schema::Loader v0.07049 @ 2022-09-14 09:34:13
420 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:jvSp6ba0qGenaEBt4HEDww
422 __PACKAGE__->belongs_to(
424 "Koha::Schema::Result::Item",
425 { itemnumber => "itemnumber" },
429 on_delete => "CASCADE",
430 on_update => "CASCADE",
434 __PACKAGE__->belongs_to(
436 "Koha::Schema::Result::Biblio",
437 { biblionumber => "biblionumber" },
441 on_delete => "CASCADE",
442 on_update => "CASCADE",
446 __PACKAGE__->belongs_to(
448 "Koha::Schema::Result::Borrower",
449 { "foreign.borrowernumber" => "self.borrowernumber" },
450 { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
453 __PACKAGE__->add_columns(
454 '+item_level_hold' => { is_boolean => 1 },
455 '+lowestPriority' => { is_boolean => 1 },
456 '+suspend' => { is_boolean => 1 },
457 '+non_priority' => { is_boolean => 1 }
460 sub koha_object_class {
463 sub koha_objects_class {
467 __PACKAGE__->belongs_to(
469 "Koha::Schema::Result::Item",
470 { biblionumber => "biblionumber" },
474 on_delete => "CASCADE",
475 on_update => "CASCADE",