Bug 25655: DBIC schema
[srvgit] / Koha / Schema / Result / CurbsidePickupPolicy.pm
1 use utf8;
2 package Koha::Schema::Result::CurbsidePickupPolicy;
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::CurbsidePickupPolicy
10
11 =cut
12
13 use strict;
14 use warnings;
15
16 use base 'DBIx::Class::Core';
17
18 =head1 TABLE: C<curbside_pickup_policy>
19
20 =cut
21
22 __PACKAGE__->table("curbside_pickup_policy");
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 branchcode
33
34   data_type: 'varchar'
35   is_foreign_key: 1
36   is_nullable: 0
37   size: 10
38
39 =head2 enabled
40
41   data_type: 'tinyint'
42   default_value: 0
43   is_nullable: 0
44
45 =head2 enable_waiting_holds_only
46
47   data_type: 'tinyint'
48   default_value: 0
49   is_nullable: 0
50
51 =head2 pickup_interval
52
53   data_type: 'integer'
54   default_value: 0
55   is_nullable: 0
56
57 =head2 patrons_per_interval
58
59   data_type: 'integer'
60   default_value: 0
61   is_nullable: 0
62
63 =head2 patron_scheduled_pickup
64
65   data_type: 'tinyint'
66   default_value: 0
67   is_nullable: 0
68
69 =cut
70
71 __PACKAGE__->add_columns(
72   "id",
73   { data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
74   "branchcode",
75   { data_type => "varchar", is_foreign_key => 1, is_nullable => 0, size => 10 },
76   "enabled",
77   { data_type => "tinyint", default_value => 0, is_nullable => 0 },
78   "enable_waiting_holds_only",
79   { data_type => "tinyint", default_value => 0, is_nullable => 0 },
80   "pickup_interval",
81   { data_type => "integer", default_value => 0, is_nullable => 0 },
82   "patrons_per_interval",
83   { data_type => "integer", default_value => 0, is_nullable => 0 },
84   "patron_scheduled_pickup",
85   { data_type => "tinyint", default_value => 0, is_nullable => 0 },
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 UNIQUE CONSTRAINTS
101
102 =head2 C<branchcode>
103
104 =over 4
105
106 =item * L</branchcode>
107
108 =back
109
110 =cut
111
112 __PACKAGE__->add_unique_constraint("branchcode", ["branchcode"]);
113
114 =head1 RELATIONS
115
116 =head2 branchcode
117
118 Type: belongs_to
119
120 Related object: L<Koha::Schema::Result::Branch>
121
122 =cut
123
124 __PACKAGE__->belongs_to(
125   "branchcode",
126   "Koha::Schema::Result::Branch",
127   { branchcode => "branchcode" },
128   { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
129 );
130
131 =head2 curbside_pickup_opening_slots
132
133 Type: has_many
134
135 Related object: L<Koha::Schema::Result::CurbsidePickupOpeningSlot>
136
137 =cut
138
139 __PACKAGE__->has_many(
140   "curbside_pickup_opening_slots",
141   "Koha::Schema::Result::CurbsidePickupOpeningSlot",
142   { "foreign.curbside_pickup_policy_id" => "self.id" },
143   { cascade_copy => 0, cascade_delete => 0 },
144 );
145
146
147 # Created by DBIx::Class::Schema::Loader v0.07049 @ 2022-06-27 11:58:44
148 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:RyZGROB1+g3kb2bo6mwrUQ
149
150 __PACKAGE__->add_columns(
151     '+enabled' => { is_boolean => 1 },
152     '+enable_waiting_holds_only' => { is_boolean => 1 },
153     '+patron_scheduled_pickup' => { is_boolean => 1 },
154 );
155
156 sub koha_object_class {
157     'Koha::CurbsidePickupPolicy';
158 }
159 sub koha_objects_class {
160     'Koha::CurbsidePickupPolicies';
161 }
162
163 1;