Line 0
Link Here
|
|
|
1 |
use utf8; |
2 |
package Koha::Schema::Result::Ticket; |
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::Ticket |
10 |
|
11 |
=cut |
12 |
|
13 |
use strict; |
14 |
use warnings; |
15 |
|
16 |
use base 'DBIx::Class::Core'; |
17 |
|
18 |
=head1 TABLE: C<tickets> |
19 |
|
20 |
=cut |
21 |
|
22 |
__PACKAGE__->table("tickets"); |
23 |
|
24 |
=head1 ACCESSORS |
25 |
|
26 |
=head2 id |
27 |
|
28 |
data_type: 'integer' |
29 |
is_auto_increment: 1 |
30 |
is_nullable: 0 |
31 |
|
32 |
primary key |
33 |
|
34 |
=head2 reporter_id |
35 |
|
36 |
data_type: 'integer' |
37 |
default_value: 0 |
38 |
is_foreign_key: 1 |
39 |
is_nullable: 0 |
40 |
|
41 |
id of the patron who reported the ticket |
42 |
|
43 |
=head2 reported_date |
44 |
|
45 |
data_type: 'timestamp' |
46 |
datetime_undef_if_invalid: 1 |
47 |
default_value: current_timestamp |
48 |
is_nullable: 0 |
49 |
|
50 |
date and time this ticket was reported |
51 |
|
52 |
=head2 title |
53 |
|
54 |
data_type: 'text' |
55 |
is_nullable: 0 |
56 |
|
57 |
ticket title |
58 |
|
59 |
=head2 body |
60 |
|
61 |
data_type: 'text' |
62 |
is_nullable: 0 |
63 |
|
64 |
ticket details |
65 |
|
66 |
=head2 resolver_id |
67 |
|
68 |
data_type: 'integer' |
69 |
is_foreign_key: 1 |
70 |
is_nullable: 1 |
71 |
|
72 |
id of the user who resolved the ticket |
73 |
|
74 |
=head2 resolved_date |
75 |
|
76 |
data_type: 'datetime' |
77 |
datetime_undef_if_invalid: 1 |
78 |
is_nullable: 1 |
79 |
|
80 |
date and time this ticket was resolved |
81 |
|
82 |
=head2 biblio_id |
83 |
|
84 |
data_type: 'integer' |
85 |
is_foreign_key: 1 |
86 |
is_nullable: 1 |
87 |
|
88 |
id of biblio linked |
89 |
|
90 |
=cut |
91 |
|
92 |
__PACKAGE__->add_columns( |
93 |
"id", |
94 |
{ data_type => "integer", is_auto_increment => 1, is_nullable => 0 }, |
95 |
"reporter_id", |
96 |
{ |
97 |
data_type => "integer", |
98 |
default_value => 0, |
99 |
is_foreign_key => 1, |
100 |
is_nullable => 0, |
101 |
}, |
102 |
"reported_date", |
103 |
{ |
104 |
data_type => "timestamp", |
105 |
datetime_undef_if_invalid => 1, |
106 |
default_value => \"current_timestamp", |
107 |
is_nullable => 0, |
108 |
}, |
109 |
"title", |
110 |
{ data_type => "text", is_nullable => 0 }, |
111 |
"body", |
112 |
{ data_type => "text", is_nullable => 0 }, |
113 |
"resolver_id", |
114 |
{ data_type => "integer", is_foreign_key => 1, is_nullable => 1 }, |
115 |
"resolved_date", |
116 |
{ |
117 |
data_type => "datetime", |
118 |
datetime_undef_if_invalid => 1, |
119 |
is_nullable => 1, |
120 |
}, |
121 |
"biblio_id", |
122 |
{ data_type => "integer", is_foreign_key => 1, is_nullable => 1 }, |
123 |
); |
124 |
|
125 |
=head1 PRIMARY KEY |
126 |
|
127 |
=over 4 |
128 |
|
129 |
=item * L</id> |
130 |
|
131 |
=back |
132 |
|
133 |
=cut |
134 |
|
135 |
__PACKAGE__->set_primary_key("id"); |
136 |
|
137 |
=head1 RELATIONS |
138 |
|
139 |
=head2 biblio |
140 |
|
141 |
Type: belongs_to |
142 |
|
143 |
Related object: L<Koha::Schema::Result::Biblio> |
144 |
|
145 |
=cut |
146 |
|
147 |
__PACKAGE__->belongs_to( |
148 |
"biblio", |
149 |
"Koha::Schema::Result::Biblio", |
150 |
{ biblionumber => "biblio_id" }, |
151 |
{ |
152 |
is_deferrable => 1, |
153 |
join_type => "LEFT", |
154 |
on_delete => "CASCADE", |
155 |
on_update => "CASCADE", |
156 |
}, |
157 |
); |
158 |
|
159 |
=head2 reporter |
160 |
|
161 |
Type: belongs_to |
162 |
|
163 |
Related object: L<Koha::Schema::Result::Borrower> |
164 |
|
165 |
=cut |
166 |
|
167 |
__PACKAGE__->belongs_to( |
168 |
"reporter", |
169 |
"Koha::Schema::Result::Borrower", |
170 |
{ borrowernumber => "reporter_id" }, |
171 |
{ is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }, |
172 |
); |
173 |
|
174 |
=head2 resolver |
175 |
|
176 |
Type: belongs_to |
177 |
|
178 |
Related object: L<Koha::Schema::Result::Borrower> |
179 |
|
180 |
=cut |
181 |
|
182 |
__PACKAGE__->belongs_to( |
183 |
"resolver", |
184 |
"Koha::Schema::Result::Borrower", |
185 |
{ borrowernumber => "resolver_id" }, |
186 |
{ |
187 |
is_deferrable => 1, |
188 |
join_type => "LEFT", |
189 |
on_delete => "CASCADE", |
190 |
on_update => "CASCADE", |
191 |
}, |
192 |
); |
193 |
|
194 |
=head2 ticket_updates |
195 |
|
196 |
Type: has_many |
197 |
|
198 |
Related object: L<Koha::Schema::Result::TicketUpdate> |
199 |
|
200 |
=cut |
201 |
|
202 |
__PACKAGE__->has_many( |
203 |
"ticket_updates", |
204 |
"Koha::Schema::Result::TicketUpdate", |
205 |
{ "foreign.ticket_id" => "self.id" }, |
206 |
{ cascade_copy => 0, cascade_delete => 0 }, |
207 |
); |
208 |
|
209 |
|
210 |
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2022-10-24 21:15:34 |
211 |
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:0Nm+y1BHJicrpeq3kuU1VA |
212 |
|
213 |
|
214 |
# You can replace this text with custom code or comments, and it will be preserved on regeneration |
215 |
1; |