875c2103558d9206ce4980ccda136857efdacab1
[koha.git] / Koha / Schema / Result / Branch.pm
1 use utf8;
2 package Koha::Schema::Result::Branch;
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::Branch
10
11 =cut
12
13 use strict;
14 use warnings;
15
16 use base 'DBIx::Class::Core';
17
18 =head1 TABLE: C<branches>
19
20 =cut
21
22 __PACKAGE__->table("branches");
23
24 =head1 ACCESSORS
25
26 =head2 branchcode
27
28   data_type: 'varchar'
29   default_value: (empty string)
30   is_nullable: 0
31   size: 10
32
33 =head2 branchname
34
35   data_type: 'mediumtext'
36   is_nullable: 0
37
38 =head2 branchaddress1
39
40   data_type: 'mediumtext'
41   is_nullable: 1
42
43 =head2 branchaddress2
44
45   data_type: 'mediumtext'
46   is_nullable: 1
47
48 =head2 branchaddress3
49
50   data_type: 'mediumtext'
51   is_nullable: 1
52
53 =head2 branchzip
54
55   data_type: 'varchar'
56   is_nullable: 1
57   size: 25
58
59 =head2 branchcity
60
61   data_type: 'mediumtext'
62   is_nullable: 1
63
64 =head2 branchstate
65
66   data_type: 'mediumtext'
67   is_nullable: 1
68
69 =head2 branchcountry
70
71   data_type: 'text'
72   is_nullable: 1
73
74 =head2 branchphone
75
76   data_type: 'mediumtext'
77   is_nullable: 1
78
79 =head2 branchfax
80
81   data_type: 'mediumtext'
82   is_nullable: 1
83
84 =head2 branchemail
85
86   data_type: 'mediumtext'
87   is_nullable: 1
88
89 =head2 branchreplyto
90
91   data_type: 'mediumtext'
92   is_nullable: 1
93
94 =head2 branchreturnpath
95
96   data_type: 'mediumtext'
97   is_nullable: 1
98
99 =head2 branchurl
100
101   data_type: 'mediumtext'
102   is_nullable: 1
103
104 =head2 issuing
105
106   data_type: 'tinyint'
107   is_nullable: 1
108
109 =head2 branchip
110
111   data_type: 'varchar'
112   is_nullable: 1
113   size: 15
114
115 =head2 branchprinter
116
117   data_type: 'varchar'
118   is_nullable: 1
119   size: 100
120
121 =head2 branchnotes
122
123   data_type: 'mediumtext'
124   is_nullable: 1
125
126 =head2 opac_info
127
128   data_type: 'text'
129   is_nullable: 1
130
131 =head2 geolocation
132
133   data_type: 'varchar'
134   is_nullable: 1
135   size: 255
136
137 =cut
138
139 __PACKAGE__->add_columns(
140   "branchcode",
141   { data_type => "varchar", default_value => "", is_nullable => 0, size => 10 },
142   "branchname",
143   { data_type => "mediumtext", is_nullable => 0 },
144   "branchaddress1",
145   { data_type => "mediumtext", is_nullable => 1 },
146   "branchaddress2",
147   { data_type => "mediumtext", is_nullable => 1 },
148   "branchaddress3",
149   { data_type => "mediumtext", is_nullable => 1 },
150   "branchzip",
151   { data_type => "varchar", is_nullable => 1, size => 25 },
152   "branchcity",
153   { data_type => "mediumtext", is_nullable => 1 },
154   "branchstate",
155   { data_type => "mediumtext", is_nullable => 1 },
156   "branchcountry",
157   { data_type => "text", is_nullable => 1 },
158   "branchphone",
159   { data_type => "mediumtext", is_nullable => 1 },
160   "branchfax",
161   { data_type => "mediumtext", is_nullable => 1 },
162   "branchemail",
163   { data_type => "mediumtext", is_nullable => 1 },
164   "branchreplyto",
165   { data_type => "mediumtext", is_nullable => 1 },
166   "branchreturnpath",
167   { data_type => "mediumtext", is_nullable => 1 },
168   "branchurl",
169   { data_type => "mediumtext", is_nullable => 1 },
170   "issuing",
171   { data_type => "tinyint", is_nullable => 1 },
172   "branchip",
173   { data_type => "varchar", is_nullable => 1, size => 15 },
174   "branchprinter",
175   { data_type => "varchar", is_nullable => 1, size => 100 },
176   "branchnotes",
177   { data_type => "mediumtext", is_nullable => 1 },
178   "opac_info",
179   { data_type => "text", is_nullable => 1 },
180   "geolocation",
181   { data_type => "varchar", is_nullable => 1, size => 255 },
182 );
183
184 =head1 PRIMARY KEY
185
186 =over 4
187
188 =item * L</branchcode>
189
190 =back
191
192 =cut
193
194 __PACKAGE__->set_primary_key("branchcode");
195
196 =head1 RELATIONS
197
198 =head2 aqbaskets
199
200 Type: has_many
201
202 Related object: L<Koha::Schema::Result::Aqbasket>
203
204 =cut
205
206 __PACKAGE__->has_many(
207   "aqbaskets",
208   "Koha::Schema::Result::Aqbasket",
209   { "foreign.branch" => "self.branchcode" },
210   { cascade_copy => 0, cascade_delete => 0 },
211 );
212
213 =head2 article_requests
214
215 Type: has_many
216
217 Related object: L<Koha::Schema::Result::ArticleRequest>
218
219 =cut
220
221 __PACKAGE__->has_many(
222   "article_requests",
223   "Koha::Schema::Result::ArticleRequest",
224   { "foreign.branchcode" => "self.branchcode" },
225   { cascade_copy => 0, cascade_delete => 0 },
226 );
227
228 =head2 authorised_values_branches
229
230 Type: has_many
231
232 Related object: L<Koha::Schema::Result::AuthorisedValuesBranch>
233
234 =cut
235
236 __PACKAGE__->has_many(
237   "authorised_values_branches",
238   "Koha::Schema::Result::AuthorisedValuesBranch",
239   { "foreign.branchcode" => "self.branchcode" },
240   { cascade_copy => 0, cascade_delete => 0 },
241 );
242
243 =head2 borrower_attribute_types_branches
244
245 Type: has_many
246
247 Related object: L<Koha::Schema::Result::BorrowerAttributeTypesBranch>
248
249 =cut
250
251 __PACKAGE__->has_many(
252   "borrower_attribute_types_branches",
253   "Koha::Schema::Result::BorrowerAttributeTypesBranch",
254   { "foreign.b_branchcode" => "self.branchcode" },
255   { cascade_copy => 0, cascade_delete => 0 },
256 );
257
258 =head2 borrowers
259
260 Type: has_many
261
262 Related object: L<Koha::Schema::Result::Borrower>
263
264 =cut
265
266 __PACKAGE__->has_many(
267   "borrowers",
268   "Koha::Schema::Result::Borrower",
269   { "foreign.branchcode" => "self.branchcode" },
270   { cascade_copy => 0, cascade_delete => 0 },
271 );
272
273 =head2 branch_borrower_circ_rules
274
275 Type: has_many
276
277 Related object: L<Koha::Schema::Result::BranchBorrowerCircRule>
278
279 =cut
280
281 __PACKAGE__->has_many(
282   "branch_borrower_circ_rules",
283   "Koha::Schema::Result::BranchBorrowerCircRule",
284   { "foreign.branchcode" => "self.branchcode" },
285   { cascade_copy => 0, cascade_delete => 0 },
286 );
287
288 =head2 branch_item_rules
289
290 Type: has_many
291
292 Related object: L<Koha::Schema::Result::BranchItemRule>
293
294 =cut
295
296 __PACKAGE__->has_many(
297   "branch_item_rules",
298   "Koha::Schema::Result::BranchItemRule",
299   { "foreign.branchcode" => "self.branchcode" },
300   { cascade_copy => 0, cascade_delete => 0 },
301 );
302
303 =head2 branchrelations
304
305 Type: has_many
306
307 Related object: L<Koha::Schema::Result::Branchrelation>
308
309 =cut
310
311 __PACKAGE__->has_many(
312   "branchrelations",
313   "Koha::Schema::Result::Branchrelation",
314   { "foreign.branchcode" => "self.branchcode" },
315   { cascade_copy => 0, cascade_delete => 0 },
316 );
317
318 =head2 branchtransfers_frombranches
319
320 Type: has_many
321
322 Related object: L<Koha::Schema::Result::Branchtransfer>
323
324 =cut
325
326 __PACKAGE__->has_many(
327   "branchtransfers_frombranches",
328   "Koha::Schema::Result::Branchtransfer",
329   { "foreign.frombranch" => "self.branchcode" },
330   { cascade_copy => 0, cascade_delete => 0 },
331 );
332
333 =head2 branchtransfers_tobranches
334
335 Type: has_many
336
337 Related object: L<Koha::Schema::Result::Branchtransfer>
338
339 =cut
340
341 __PACKAGE__->has_many(
342   "branchtransfers_tobranches",
343   "Koha::Schema::Result::Branchtransfer",
344   { "foreign.tobranch" => "self.branchcode" },
345   { cascade_copy => 0, cascade_delete => 0 },
346 );
347
348 =head2 categories_branches
349
350 Type: has_many
351
352 Related object: L<Koha::Schema::Result::CategoriesBranch>
353
354 =cut
355
356 __PACKAGE__->has_many(
357   "categories_branches",
358   "Koha::Schema::Result::CategoriesBranch",
359   { "foreign.branchcode" => "self.branchcode" },
360   { cascade_copy => 0, cascade_delete => 0 },
361 );
362
363 =head2 collections
364
365 Type: has_many
366
367 Related object: L<Koha::Schema::Result::Collection>
368
369 =cut
370
371 __PACKAGE__->has_many(
372   "collections",
373   "Koha::Schema::Result::Collection",
374   { "foreign.colBranchcode" => "self.branchcode" },
375   { cascade_copy => 0, cascade_delete => 0 },
376 );
377
378 =head2 course_items
379
380 Type: has_many
381
382 Related object: L<Koha::Schema::Result::CourseItem>
383
384 =cut
385
386 __PACKAGE__->has_many(
387   "course_items",
388   "Koha::Schema::Result::CourseItem",
389   { "foreign.holdingbranch" => "self.branchcode" },
390   { cascade_copy => 0, cascade_delete => 0 },
391 );
392
393 =head2 creator_batches
394
395 Type: has_many
396
397 Related object: L<Koha::Schema::Result::CreatorBatch>
398
399 =cut
400
401 __PACKAGE__->has_many(
402   "creator_batches",
403   "Koha::Schema::Result::CreatorBatch",
404   { "foreign.branch_code" => "self.branchcode" },
405   { cascade_copy => 0, cascade_delete => 0 },
406 );
407
408 =head2 default_branch_circ_rule
409
410 Type: might_have
411
412 Related object: L<Koha::Schema::Result::DefaultBranchCircRule>
413
414 =cut
415
416 __PACKAGE__->might_have(
417   "default_branch_circ_rule",
418   "Koha::Schema::Result::DefaultBranchCircRule",
419   { "foreign.branchcode" => "self.branchcode" },
420   { cascade_copy => 0, cascade_delete => 0 },
421 );
422
423 =head2 edifact_eans
424
425 Type: has_many
426
427 Related object: L<Koha::Schema::Result::EdifactEan>
428
429 =cut
430
431 __PACKAGE__->has_many(
432   "edifact_eans",
433   "Koha::Schema::Result::EdifactEan",
434   { "foreign.branchcode" => "self.branchcode" },
435   { cascade_copy => 0, cascade_delete => 0 },
436 );
437
438 =head2 hold_fill_targets
439
440 Type: has_many
441
442 Related object: L<Koha::Schema::Result::HoldFillTarget>
443
444 =cut
445
446 __PACKAGE__->has_many(
447   "hold_fill_targets",
448   "Koha::Schema::Result::HoldFillTarget",
449   { "foreign.source_branchcode" => "self.branchcode" },
450   { cascade_copy => 0, cascade_delete => 0 },
451 );
452
453 =head2 items_holdingbranches
454
455 Type: has_many
456
457 Related object: L<Koha::Schema::Result::Item>
458
459 =cut
460
461 __PACKAGE__->has_many(
462   "items_holdingbranches",
463   "Koha::Schema::Result::Item",
464   { "foreign.holdingbranch" => "self.branchcode" },
465   { cascade_copy => 0, cascade_delete => 0 },
466 );
467
468 =head2 items_homebranches
469
470 Type: has_many
471
472 Related object: L<Koha::Schema::Result::Item>
473
474 =cut
475
476 __PACKAGE__->has_many(
477   "items_homebranches",
478   "Koha::Schema::Result::Item",
479   { "foreign.homebranch" => "self.branchcode" },
480   { cascade_copy => 0, cascade_delete => 0 },
481 );
482
483 =head2 opac_news
484
485 Type: has_many
486
487 Related object: L<Koha::Schema::Result::OpacNews>
488
489 =cut
490
491 __PACKAGE__->has_many(
492   "opac_news",
493   "Koha::Schema::Result::OpacNews",
494   { "foreign.branchcode" => "self.branchcode" },
495   { cascade_copy => 0, cascade_delete => 0 },
496 );
497
498 =head2 reserves
499
500 Type: has_many
501
502 Related object: L<Koha::Schema::Result::Reserve>
503
504 =cut
505
506 __PACKAGE__->has_many(
507   "reserves",
508   "Koha::Schema::Result::Reserve",
509   { "foreign.branchcode" => "self.branchcode" },
510   { cascade_copy => 0, cascade_delete => 0 },
511 );
512
513 =head2 transport_cost_frombranches
514
515 Type: has_many
516
517 Related object: L<Koha::Schema::Result::TransportCost>
518
519 =cut
520
521 __PACKAGE__->has_many(
522   "transport_cost_frombranches",
523   "Koha::Schema::Result::TransportCost",
524   { "foreign.frombranch" => "self.branchcode" },
525   { cascade_copy => 0, cascade_delete => 0 },
526 );
527
528 =head2 transport_cost_tobranches
529
530 Type: has_many
531
532 Related object: L<Koha::Schema::Result::TransportCost>
533
534 =cut
535
536 __PACKAGE__->has_many(
537   "transport_cost_tobranches",
538   "Koha::Schema::Result::TransportCost",
539   { "foreign.tobranch" => "self.branchcode" },
540   { cascade_copy => 0, cascade_delete => 0 },
541 );
542
543 =head2 categorycodes
544
545 Type: many_to_many
546
547 Composing rels: L</branchrelations> -> categorycode
548
549 =cut
550
551 __PACKAGE__->many_to_many("categorycodes", "branchrelations", "categorycode");
552
553
554 # Created by DBIx::Class::Schema::Loader v0.07042 @ 2017-03-23 13:30:04
555 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:r12VO55fG0lzxkz7fVDmAA
556
557
558 # You can replace this text with custom code or comments, and it will be preserved on regeneration
559
560 sub koha_objects_class {
561     'Koha::Libraries';
562 }
563
564 1;