|
Line 0
Link Here
|
|
|
1 |
use utf8; |
| 2 |
package Koha::Schema::Result::PatronQuota; |
| 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::PatronQuota |
| 10 |
|
| 11 |
=cut |
| 12 |
|
| 13 |
use strict; |
| 14 |
use warnings; |
| 15 |
|
| 16 |
use base 'DBIx::Class::Core'; |
| 17 |
|
| 18 |
=head1 TABLE: C<patron_quota> |
| 19 |
|
| 20 |
=cut |
| 21 |
|
| 22 |
__PACKAGE__->table("patron_quota"); |
| 23 |
|
| 24 |
=head1 ACCESSORS |
| 25 |
|
| 26 |
=head2 id |
| 27 |
|
| 28 |
data_type: 'integer' |
| 29 |
is_auto_increment: 1 |
| 30 |
is_nullable: 0 |
| 31 |
|
| 32 |
unique identifier for the quota record |
| 33 |
|
| 34 |
=head2 description |
| 35 |
|
| 36 |
data_type: 'longtext' |
| 37 |
is_nullable: 0 |
| 38 |
|
| 39 |
user friendly description for the quota record |
| 40 |
|
| 41 |
=head2 patron_id |
| 42 |
|
| 43 |
data_type: 'integer' |
| 44 |
is_foreign_key: 1 |
| 45 |
is_nullable: 0 |
| 46 |
|
| 47 |
foreign key linking to borrowers.borrowernumber |
| 48 |
|
| 49 |
=head2 allocation |
| 50 |
|
| 51 |
data_type: 'integer' |
| 52 |
default_value: 0 |
| 53 |
is_nullable: 0 |
| 54 |
|
| 55 |
total quota allocation for the period |
| 56 |
|
| 57 |
=head2 used |
| 58 |
|
| 59 |
data_type: 'integer' |
| 60 |
default_value: 0 |
| 61 |
is_nullable: 0 |
| 62 |
|
| 63 |
amount of allocation used for current period |
| 64 |
|
| 65 |
=head2 start_date |
| 66 |
|
| 67 |
data_type: 'date' |
| 68 |
datetime_undef_if_invalid: 1 |
| 69 |
is_nullable: 0 |
| 70 |
|
| 71 |
start date of the allocation period |
| 72 |
|
| 73 |
=head2 end_date |
| 74 |
|
| 75 |
data_type: 'date' |
| 76 |
datetime_undef_if_invalid: 1 |
| 77 |
is_nullable: 0 |
| 78 |
|
| 79 |
end date of the allocation period |
| 80 |
|
| 81 |
=cut |
| 82 |
|
| 83 |
__PACKAGE__->add_columns( |
| 84 |
"id", |
| 85 |
{ data_type => "integer", is_auto_increment => 1, is_nullable => 0 }, |
| 86 |
"description", |
| 87 |
{ data_type => "longtext", is_nullable => 0 }, |
| 88 |
"patron_id", |
| 89 |
{ data_type => "integer", is_foreign_key => 1, is_nullable => 0 }, |
| 90 |
"allocation", |
| 91 |
{ data_type => "integer", default_value => 0, is_nullable => 0 }, |
| 92 |
"used", |
| 93 |
{ data_type => "integer", default_value => 0, is_nullable => 0 }, |
| 94 |
"start_date", |
| 95 |
{ data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 0 }, |
| 96 |
"end_date", |
| 97 |
{ data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 0 }, |
| 98 |
); |
| 99 |
|
| 100 |
=head1 PRIMARY KEY |
| 101 |
|
| 102 |
=over 4 |
| 103 |
|
| 104 |
=item * L</id> |
| 105 |
|
| 106 |
=back |
| 107 |
|
| 108 |
=cut |
| 109 |
|
| 110 |
__PACKAGE__->set_primary_key("id"); |
| 111 |
|
| 112 |
=head1 RELATIONS |
| 113 |
|
| 114 |
=head2 patron |
| 115 |
|
| 116 |
Type: belongs_to |
| 117 |
|
| 118 |
Related object: L<Koha::Schema::Result::Borrower> |
| 119 |
|
| 120 |
=cut |
| 121 |
|
| 122 |
__PACKAGE__->belongs_to( |
| 123 |
"patron", |
| 124 |
"Koha::Schema::Result::Borrower", |
| 125 |
{ borrowernumber => "patron_id" }, |
| 126 |
{ is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }, |
| 127 |
); |
| 128 |
|
| 129 |
=head2 patron_quota_usages |
| 130 |
|
| 131 |
Type: has_many |
| 132 |
|
| 133 |
Related object: L<Koha::Schema::Result::PatronQuotaUsage> |
| 134 |
|
| 135 |
=cut |
| 136 |
|
| 137 |
__PACKAGE__->has_many( |
| 138 |
"patron_quota_usages", |
| 139 |
"Koha::Schema::Result::PatronQuotaUsage", |
| 140 |
{ "foreign.patron_quota_id" => "self.id" }, |
| 141 |
{ cascade_copy => 0, cascade_delete => 0 }, |
| 142 |
); |
| 143 |
|
| 144 |
|
| 145 |
# Created by DBIx::Class::Schema::Loader v0.07051 @ 2025-01-30 16:04:36 |
| 146 |
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:KG/MIjPSLcpeSlPypwli2Q |
| 147 |
|
| 148 |
|
| 149 |
# You can replace this text with custom code or comments, and it will be preserved on regeneration |
| 150 |
1; |