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 => 1, 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" },
343 on_delete => "CASCADE",
344 on_update => "CASCADE",
348 =head2 club_holds_to_patron_holds
352 Related object: L<Koha::Schema::Result::ClubHoldsToPatronHold>
356 __PACKAGE__->has_many(
357 "club_holds_to_patron_holds",
358 "Koha::Schema::Result::ClubHoldsToPatronHold",
359 { "foreign.hold_id" => "self.reserve_id" },
360 { cascade_copy => 0, cascade_delete => 0 },
367 Related object: L<Koha::Schema::Result::Desk>
371 __PACKAGE__->belongs_to(
373 "Koha::Schema::Result::Desk",
374 { desk_id => "desk_id" },
378 on_delete => "SET NULL",
379 on_update => "CASCADE",
387 Related object: L<Koha::Schema::Result::Item>
391 __PACKAGE__->belongs_to(
393 "Koha::Schema::Result::Item",
394 { itemnumber => "itemnumber" },
398 on_delete => "CASCADE",
399 on_update => "CASCADE",
407 Related object: L<Koha::Schema::Result::Itemtype>
411 __PACKAGE__->belongs_to(
413 "Koha::Schema::Result::Itemtype",
414 { itemtype => "itemtype" },
418 on_delete => "CASCADE",
419 on_update => "CASCADE",
424 # Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-01-21 13:39:29
425 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:BlMb2M0MEmFuTiMSSBEseg
427 __PACKAGE__->belongs_to(
429 "Koha::Schema::Result::Item",
430 { itemnumber => "itemnumber" },
434 on_delete => "CASCADE",
435 on_update => "CASCADE",
439 __PACKAGE__->belongs_to(
441 "Koha::Schema::Result::Biblio",
442 { biblionumber => "biblionumber" },
446 on_delete => "CASCADE",
447 on_update => "CASCADE",
451 __PACKAGE__->belongs_to(
453 "Koha::Schema::Result::Borrower",
454 { "foreign.borrowernumber" => "self.borrowernumber" },
455 { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
458 __PACKAGE__->add_columns(
459 '+item_level_hold' => { is_boolean => 1 },
460 '+lowestPriority' => { is_boolean => 1 },
461 '+suspend' => { is_boolean => 1 },
462 '+non_priority' => { is_boolean => 1 }
465 sub koha_object_class {
468 sub koha_objects_class {