Bug 12461 - Add patron clubs feature
[koha.git] / Koha / Schema / Result / Borrower.pm
1 use utf8;
2 package Koha::Schema::Result::Borrower;
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::Borrower
10
11 =cut
12
13 use strict;
14 use warnings;
15
16 use base 'DBIx::Class::Core';
17
18 =head1 TABLE: C<borrowers>
19
20 =cut
21
22 __PACKAGE__->table("borrowers");
23
24 =head1 ACCESSORS
25
26 =head2 borrowernumber
27
28   data_type: 'integer'
29   is_auto_increment: 1
30   is_nullable: 0
31
32 =head2 cardnumber
33
34   data_type: 'varchar'
35   is_nullable: 1
36   size: 16
37
38 =head2 surname
39
40   data_type: 'mediumtext'
41   is_nullable: 0
42
43 =head2 firstname
44
45   data_type: 'text'
46   is_nullable: 1
47
48 =head2 title
49
50   data_type: 'mediumtext'
51   is_nullable: 1
52
53 =head2 othernames
54
55   data_type: 'mediumtext'
56   is_nullable: 1
57
58 =head2 initials
59
60   data_type: 'text'
61   is_nullable: 1
62
63 =head2 streetnumber
64
65   data_type: 'varchar'
66   is_nullable: 1
67   size: 10
68
69 =head2 streettype
70
71   data_type: 'varchar'
72   is_nullable: 1
73   size: 50
74
75 =head2 address
76
77   data_type: 'mediumtext'
78   is_nullable: 0
79
80 =head2 address2
81
82   data_type: 'text'
83   is_nullable: 1
84
85 =head2 city
86
87   data_type: 'mediumtext'
88   is_nullable: 0
89
90 =head2 state
91
92   data_type: 'text'
93   is_nullable: 1
94
95 =head2 zipcode
96
97   data_type: 'varchar'
98   is_nullable: 1
99   size: 25
100
101 =head2 country
102
103   data_type: 'text'
104   is_nullable: 1
105
106 =head2 email
107
108   data_type: 'mediumtext'
109   is_nullable: 1
110
111 =head2 phone
112
113   data_type: 'text'
114   is_nullable: 1
115
116 =head2 mobile
117
118   data_type: 'varchar'
119   is_nullable: 1
120   size: 50
121
122 =head2 fax
123
124   data_type: 'mediumtext'
125   is_nullable: 1
126
127 =head2 emailpro
128
129   data_type: 'text'
130   is_nullable: 1
131
132 =head2 phonepro
133
134   data_type: 'text'
135   is_nullable: 1
136
137 =head2 B_streetnumber
138
139   accessor: 'b_streetnumber'
140   data_type: 'varchar'
141   is_nullable: 1
142   size: 10
143
144 =head2 B_streettype
145
146   accessor: 'b_streettype'
147   data_type: 'varchar'
148   is_nullable: 1
149   size: 50
150
151 =head2 B_address
152
153   accessor: 'b_address'
154   data_type: 'varchar'
155   is_nullable: 1
156   size: 100
157
158 =head2 B_address2
159
160   accessor: 'b_address2'
161   data_type: 'text'
162   is_nullable: 1
163
164 =head2 B_city
165
166   accessor: 'b_city'
167   data_type: 'mediumtext'
168   is_nullable: 1
169
170 =head2 B_state
171
172   accessor: 'b_state'
173   data_type: 'text'
174   is_nullable: 1
175
176 =head2 B_zipcode
177
178   accessor: 'b_zipcode'
179   data_type: 'varchar'
180   is_nullable: 1
181   size: 25
182
183 =head2 B_country
184
185   accessor: 'b_country'
186   data_type: 'text'
187   is_nullable: 1
188
189 =head2 B_email
190
191   accessor: 'b_email'
192   data_type: 'text'
193   is_nullable: 1
194
195 =head2 B_phone
196
197   accessor: 'b_phone'
198   data_type: 'mediumtext'
199   is_nullable: 1
200
201 =head2 dateofbirth
202
203   data_type: 'date'
204   datetime_undef_if_invalid: 1
205   is_nullable: 1
206
207 =head2 branchcode
208
209   data_type: 'varchar'
210   default_value: (empty string)
211   is_foreign_key: 1
212   is_nullable: 0
213   size: 10
214
215 =head2 categorycode
216
217   data_type: 'varchar'
218   default_value: (empty string)
219   is_foreign_key: 1
220   is_nullable: 0
221   size: 10
222
223 =head2 dateenrolled
224
225   data_type: 'date'
226   datetime_undef_if_invalid: 1
227   is_nullable: 1
228
229 =head2 dateexpiry
230
231   data_type: 'date'
232   datetime_undef_if_invalid: 1
233   is_nullable: 1
234
235 =head2 gonenoaddress
236
237   data_type: 'tinyint'
238   is_nullable: 1
239
240 =head2 lost
241
242   data_type: 'tinyint'
243   is_nullable: 1
244
245 =head2 debarred
246
247   data_type: 'date'
248   datetime_undef_if_invalid: 1
249   is_nullable: 1
250
251 =head2 debarredcomment
252
253   data_type: 'varchar'
254   is_nullable: 1
255   size: 255
256
257 =head2 contactname
258
259   data_type: 'mediumtext'
260   is_nullable: 1
261
262 =head2 contactfirstname
263
264   data_type: 'text'
265   is_nullable: 1
266
267 =head2 contacttitle
268
269   data_type: 'text'
270   is_nullable: 1
271
272 =head2 guarantorid
273
274   data_type: 'integer'
275   is_nullable: 1
276
277 =head2 borrowernotes
278
279   data_type: 'mediumtext'
280   is_nullable: 1
281
282 =head2 relationship
283
284   data_type: 'varchar'
285   is_nullable: 1
286   size: 100
287
288 =head2 sex
289
290   data_type: 'varchar'
291   is_nullable: 1
292   size: 1
293
294 =head2 password
295
296   data_type: 'varchar'
297   is_nullable: 1
298   size: 60
299
300 =head2 flags
301
302   data_type: 'integer'
303   is_nullable: 1
304
305 =head2 userid
306
307   data_type: 'varchar'
308   is_nullable: 1
309   size: 75
310
311 =head2 opacnote
312
313   data_type: 'mediumtext'
314   is_nullable: 1
315
316 =head2 contactnote
317
318   data_type: 'varchar'
319   is_nullable: 1
320   size: 255
321
322 =head2 sort1
323
324   data_type: 'varchar'
325   is_nullable: 1
326   size: 80
327
328 =head2 sort2
329
330   data_type: 'varchar'
331   is_nullable: 1
332   size: 80
333
334 =head2 altcontactfirstname
335
336   data_type: 'varchar'
337   is_nullable: 1
338   size: 255
339
340 =head2 altcontactsurname
341
342   data_type: 'varchar'
343   is_nullable: 1
344   size: 255
345
346 =head2 altcontactaddress1
347
348   data_type: 'varchar'
349   is_nullable: 1
350   size: 255
351
352 =head2 altcontactaddress2
353
354   data_type: 'varchar'
355   is_nullable: 1
356   size: 255
357
358 =head2 altcontactaddress3
359
360   data_type: 'varchar'
361   is_nullable: 1
362   size: 255
363
364 =head2 altcontactstate
365
366   data_type: 'text'
367   is_nullable: 1
368
369 =head2 altcontactzipcode
370
371   data_type: 'varchar'
372   is_nullable: 1
373   size: 50
374
375 =head2 altcontactcountry
376
377   data_type: 'text'
378   is_nullable: 1
379
380 =head2 altcontactphone
381
382   data_type: 'varchar'
383   is_nullable: 1
384   size: 50
385
386 =head2 smsalertnumber
387
388   data_type: 'varchar'
389   is_nullable: 1
390   size: 50
391
392 =head2 sms_provider_id
393
394   data_type: 'integer'
395   is_foreign_key: 1
396   is_nullable: 1
397
398 =head2 privacy
399
400   data_type: 'integer'
401   default_value: 1
402   is_nullable: 0
403
404 =head2 privacy_guarantor_checkouts
405
406   data_type: 'tinyint'
407   default_value: 0
408   is_nullable: 0
409
410 =head2 checkprevcheckout
411
412   data_type: 'varchar'
413   default_value: 'inherit'
414   is_nullable: 0
415   size: 7
416
417 =head2 updated_on
418
419   data_type: 'timestamp'
420   datetime_undef_if_invalid: 1
421   default_value: current_timestamp
422   is_nullable: 0
423
424 =head2 lastseen
425
426   data_type: 'datetime'
427   datetime_undef_if_invalid: 1
428   is_nullable: 1
429
430 =cut
431
432 __PACKAGE__->add_columns(
433   "borrowernumber",
434   { data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
435   "cardnumber",
436   { data_type => "varchar", is_nullable => 1, size => 16 },
437   "surname",
438   { data_type => "mediumtext", is_nullable => 0 },
439   "firstname",
440   { data_type => "text", is_nullable => 1 },
441   "title",
442   { data_type => "mediumtext", is_nullable => 1 },
443   "othernames",
444   { data_type => "mediumtext", is_nullable => 1 },
445   "initials",
446   { data_type => "text", is_nullable => 1 },
447   "streetnumber",
448   { data_type => "varchar", is_nullable => 1, size => 10 },
449   "streettype",
450   { data_type => "varchar", is_nullable => 1, size => 50 },
451   "address",
452   { data_type => "mediumtext", is_nullable => 0 },
453   "address2",
454   { data_type => "text", is_nullable => 1 },
455   "city",
456   { data_type => "mediumtext", is_nullable => 0 },
457   "state",
458   { data_type => "text", is_nullable => 1 },
459   "zipcode",
460   { data_type => "varchar", is_nullable => 1, size => 25 },
461   "country",
462   { data_type => "text", is_nullable => 1 },
463   "email",
464   { data_type => "mediumtext", is_nullable => 1 },
465   "phone",
466   { data_type => "text", is_nullable => 1 },
467   "mobile",
468   { data_type => "varchar", is_nullable => 1, size => 50 },
469   "fax",
470   { data_type => "mediumtext", is_nullable => 1 },
471   "emailpro",
472   { data_type => "text", is_nullable => 1 },
473   "phonepro",
474   { data_type => "text", is_nullable => 1 },
475   "B_streetnumber",
476   {
477     accessor => "b_streetnumber",
478     data_type => "varchar",
479     is_nullable => 1,
480     size => 10,
481   },
482   "B_streettype",
483   {
484     accessor => "b_streettype",
485     data_type => "varchar",
486     is_nullable => 1,
487     size => 50,
488   },
489   "B_address",
490   {
491     accessor => "b_address",
492     data_type => "varchar",
493     is_nullable => 1,
494     size => 100,
495   },
496   "B_address2",
497   { accessor => "b_address2", data_type => "text", is_nullable => 1 },
498   "B_city",
499   { accessor => "b_city", data_type => "mediumtext", is_nullable => 1 },
500   "B_state",
501   { accessor => "b_state", data_type => "text", is_nullable => 1 },
502   "B_zipcode",
503   {
504     accessor => "b_zipcode",
505     data_type => "varchar",
506     is_nullable => 1,
507     size => 25,
508   },
509   "B_country",
510   { accessor => "b_country", data_type => "text", is_nullable => 1 },
511   "B_email",
512   { accessor => "b_email", data_type => "text", is_nullable => 1 },
513   "B_phone",
514   { accessor => "b_phone", data_type => "mediumtext", is_nullable => 1 },
515   "dateofbirth",
516   { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
517   "branchcode",
518   {
519     data_type => "varchar",
520     default_value => "",
521     is_foreign_key => 1,
522     is_nullable => 0,
523     size => 10,
524   },
525   "categorycode",
526   {
527     data_type => "varchar",
528     default_value => "",
529     is_foreign_key => 1,
530     is_nullable => 0,
531     size => 10,
532   },
533   "dateenrolled",
534   { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
535   "dateexpiry",
536   { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
537   "gonenoaddress",
538   { data_type => "tinyint", is_nullable => 1 },
539   "lost",
540   { data_type => "tinyint", is_nullable => 1 },
541   "debarred",
542   { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
543   "debarredcomment",
544   { data_type => "varchar", is_nullable => 1, size => 255 },
545   "contactname",
546   { data_type => "mediumtext", is_nullable => 1 },
547   "contactfirstname",
548   { data_type => "text", is_nullable => 1 },
549   "contacttitle",
550   { data_type => "text", is_nullable => 1 },
551   "guarantorid",
552   { data_type => "integer", is_nullable => 1 },
553   "borrowernotes",
554   { data_type => "mediumtext", is_nullable => 1 },
555   "relationship",
556   { data_type => "varchar", is_nullable => 1, size => 100 },
557   "sex",
558   { data_type => "varchar", is_nullable => 1, size => 1 },
559   "password",
560   { data_type => "varchar", is_nullable => 1, size => 60 },
561   "flags",
562   { data_type => "integer", is_nullable => 1 },
563   "userid",
564   { data_type => "varchar", is_nullable => 1, size => 75 },
565   "opacnote",
566   { data_type => "mediumtext", is_nullable => 1 },
567   "contactnote",
568   { data_type => "varchar", is_nullable => 1, size => 255 },
569   "sort1",
570   { data_type => "varchar", is_nullable => 1, size => 80 },
571   "sort2",
572   { data_type => "varchar", is_nullable => 1, size => 80 },
573   "altcontactfirstname",
574   { data_type => "varchar", is_nullable => 1, size => 255 },
575   "altcontactsurname",
576   { data_type => "varchar", is_nullable => 1, size => 255 },
577   "altcontactaddress1",
578   { data_type => "varchar", is_nullable => 1, size => 255 },
579   "altcontactaddress2",
580   { data_type => "varchar", is_nullable => 1, size => 255 },
581   "altcontactaddress3",
582   { data_type => "varchar", is_nullable => 1, size => 255 },
583   "altcontactstate",
584   { data_type => "text", is_nullable => 1 },
585   "altcontactzipcode",
586   { data_type => "varchar", is_nullable => 1, size => 50 },
587   "altcontactcountry",
588   { data_type => "text", is_nullable => 1 },
589   "altcontactphone",
590   { data_type => "varchar", is_nullable => 1, size => 50 },
591   "smsalertnumber",
592   { data_type => "varchar", is_nullable => 1, size => 50 },
593   "sms_provider_id",
594   { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
595   "privacy",
596   { data_type => "integer", default_value => 1, is_nullable => 0 },
597   "privacy_guarantor_checkouts",
598   { data_type => "tinyint", default_value => 0, is_nullable => 0 },
599   "checkprevcheckout",
600   {
601     data_type => "varchar",
602     default_value => "inherit",
603     is_nullable => 0,
604     size => 7,
605   },
606   "updated_on",
607   {
608     data_type => "timestamp",
609     datetime_undef_if_invalid => 1,
610     default_value => \"current_timestamp",
611     is_nullable => 0,
612   },
613   "lastseen",
614   {
615     data_type => "datetime",
616     datetime_undef_if_invalid => 1,
617     is_nullable => 1,
618   },
619   "overdrive_auth_token",
620   { data_type => "text", is_nullable => 1 },
621 );
622
623 =head1 PRIMARY KEY
624
625 =over 4
626
627 =item * L</borrowernumber>
628
629 =back
630
631 =cut
632
633 __PACKAGE__->set_primary_key("borrowernumber");
634
635 =head1 UNIQUE CONSTRAINTS
636
637 =head2 C<cardnumber>
638
639 =over 4
640
641 =item * L</cardnumber>
642
643 =back
644
645 =cut
646
647 __PACKAGE__->add_unique_constraint("cardnumber", ["cardnumber"]);
648
649 =head2 C<userid>
650
651 =over 4
652
653 =item * L</userid>
654
655 =back
656
657 =cut
658
659 __PACKAGE__->add_unique_constraint("userid", ["userid"]);
660
661 =head1 RELATIONS
662
663 =head2 accountlines
664
665 Type: has_many
666
667 Related object: L<Koha::Schema::Result::Accountline>
668
669 =cut
670
671 __PACKAGE__->has_many(
672   "accountlines",
673   "Koha::Schema::Result::Accountline",
674   { "foreign.borrowernumber" => "self.borrowernumber" },
675   { cascade_copy => 0, cascade_delete => 0 },
676 );
677
678 =head2 accountoffsets
679
680 Type: has_many
681
682 Related object: L<Koha::Schema::Result::Accountoffset>
683
684 =cut
685
686 __PACKAGE__->has_many(
687   "accountoffsets",
688   "Koha::Schema::Result::Accountoffset",
689   { "foreign.borrowernumber" => "self.borrowernumber" },
690   { cascade_copy => 0, cascade_delete => 0 },
691 );
692
693 =head2 aqbasketusers
694
695 Type: has_many
696
697 Related object: L<Koha::Schema::Result::Aqbasketuser>
698
699 =cut
700
701 __PACKAGE__->has_many(
702   "aqbasketusers",
703   "Koha::Schema::Result::Aqbasketuser",
704   { "foreign.borrowernumber" => "self.borrowernumber" },
705   { cascade_copy => 0, cascade_delete => 0 },
706 );
707
708 =head2 aqbudgetborrowers
709
710 Type: has_many
711
712 Related object: L<Koha::Schema::Result::Aqbudgetborrower>
713
714 =cut
715
716 __PACKAGE__->has_many(
717   "aqbudgetborrowers",
718   "Koha::Schema::Result::Aqbudgetborrower",
719   { "foreign.borrowernumber" => "self.borrowernumber" },
720   { cascade_copy => 0, cascade_delete => 0 },
721 );
722
723 =head2 aqorder_users
724
725 Type: has_many
726
727 Related object: L<Koha::Schema::Result::AqorderUser>
728
729 =cut
730
731 __PACKAGE__->has_many(
732   "aqorder_users",
733   "Koha::Schema::Result::AqorderUser",
734   { "foreign.borrowernumber" => "self.borrowernumber" },
735   { cascade_copy => 0, cascade_delete => 0 },
736 );
737
738 =head2 article_requests
739
740 Type: has_many
741
742 Related object: L<Koha::Schema::Result::ArticleRequest>
743
744 =cut
745
746 __PACKAGE__->has_many(
747   "article_requests",
748   "Koha::Schema::Result::ArticleRequest",
749   { "foreign.borrowernumber" => "self.borrowernumber" },
750   { cascade_copy => 0, cascade_delete => 0 },
751 );
752
753 =head2 borrower_attributes
754
755 Type: has_many
756
757 Related object: L<Koha::Schema::Result::BorrowerAttribute>
758
759 =cut
760
761 __PACKAGE__->has_many(
762   "borrower_attributes",
763   "Koha::Schema::Result::BorrowerAttribute",
764   { "foreign.borrowernumber" => "self.borrowernumber" },
765   { cascade_copy => 0, cascade_delete => 0 },
766 );
767
768 =head2 borrower_debarments
769
770 Type: has_many
771
772 Related object: L<Koha::Schema::Result::BorrowerDebarment>
773
774 =cut
775
776 __PACKAGE__->has_many(
777   "borrower_debarments",
778   "Koha::Schema::Result::BorrowerDebarment",
779   { "foreign.borrowernumber" => "self.borrowernumber" },
780   { cascade_copy => 0, cascade_delete => 0 },
781 );
782
783 =head2 borrower_files
784
785 Type: has_many
786
787 Related object: L<Koha::Schema::Result::BorrowerFile>
788
789 =cut
790
791 __PACKAGE__->has_many(
792   "borrower_files",
793   "Koha::Schema::Result::BorrowerFile",
794   { "foreign.borrowernumber" => "self.borrowernumber" },
795   { cascade_copy => 0, cascade_delete => 0 },
796 );
797
798 =head2 borrower_message_preferences
799
800 Type: has_many
801
802 Related object: L<Koha::Schema::Result::BorrowerMessagePreference>
803
804 =cut
805
806 __PACKAGE__->has_many(
807   "borrower_message_preferences",
808   "Koha::Schema::Result::BorrowerMessagePreference",
809   { "foreign.borrowernumber" => "self.borrowernumber" },
810   { cascade_copy => 0, cascade_delete => 0 },
811 );
812
813 =head2 borrower_syncs
814
815 Type: has_many
816
817 Related object: L<Koha::Schema::Result::BorrowerSync>
818
819 =cut
820
821 __PACKAGE__->has_many(
822   "borrower_syncs",
823   "Koha::Schema::Result::BorrowerSync",
824   { "foreign.borrowernumber" => "self.borrowernumber" },
825   { cascade_copy => 0, cascade_delete => 0 },
826 );
827
828 =head2 branchcode
829
830 Type: belongs_to
831
832 Related object: L<Koha::Schema::Result::Branch>
833
834 =cut
835
836 __PACKAGE__->belongs_to(
837   "branchcode",
838   "Koha::Schema::Result::Branch",
839   { branchcode => "branchcode" },
840   { is_deferrable => 1, on_delete => "RESTRICT", on_update => "RESTRICT" },
841 );
842
843 =head2 categorycode
844
845 Type: belongs_to
846
847 Related object: L<Koha::Schema::Result::Category>
848
849 =cut
850
851 __PACKAGE__->belongs_to(
852   "categorycode",
853   "Koha::Schema::Result::Category",
854   { categorycode => "categorycode" },
855   { is_deferrable => 1, on_delete => "RESTRICT", on_update => "RESTRICT" },
856 );
857
858 =head2 club_enrollments
859
860 Type: has_many
861
862 Related object: L<Koha::Schema::Result::ClubEnrollment>
863
864 =cut
865
866 __PACKAGE__->has_many(
867   "club_enrollments",
868   "Koha::Schema::Result::ClubEnrollment",
869   { "foreign.borrowernumber" => "self.borrowernumber" },
870   { cascade_copy => 0, cascade_delete => 0 },
871 );
872
873 =head2 course_instructors
874
875 Type: has_many
876
877 Related object: L<Koha::Schema::Result::CourseInstructor>
878
879 =cut
880
881 __PACKAGE__->has_many(
882   "course_instructors",
883   "Koha::Schema::Result::CourseInstructor",
884   { "foreign.borrowernumber" => "self.borrowernumber" },
885   { cascade_copy => 0, cascade_delete => 0 },
886 );
887
888 =head2 creator_batches
889
890 Type: has_many
891
892 Related object: L<Koha::Schema::Result::CreatorBatch>
893
894 =cut
895
896 __PACKAGE__->has_many(
897   "creator_batches",
898   "Koha::Schema::Result::CreatorBatch",
899   { "foreign.borrower_number" => "self.borrowernumber" },
900   { cascade_copy => 0, cascade_delete => 0 },
901 );
902
903 =head2 discharges
904
905 Type: has_many
906
907 Related object: L<Koha::Schema::Result::Discharge>
908
909 =cut
910
911 __PACKAGE__->has_many(
912   "discharges",
913   "Koha::Schema::Result::Discharge",
914   { "foreign.borrower" => "self.borrowernumber" },
915   { cascade_copy => 0, cascade_delete => 0 },
916 );
917
918 =head2 hold_fill_targets
919
920 Type: has_many
921
922 Related object: L<Koha::Schema::Result::HoldFillTarget>
923
924 =cut
925
926 __PACKAGE__->has_many(
927   "hold_fill_targets",
928   "Koha::Schema::Result::HoldFillTarget",
929   { "foreign.borrowernumber" => "self.borrowernumber" },
930   { cascade_copy => 0, cascade_delete => 0 },
931 );
932
933 =head2 housebound_profile
934
935 Type: might_have
936
937 Related object: L<Koha::Schema::Result::HouseboundProfile>
938
939 =cut
940
941 __PACKAGE__->might_have(
942   "housebound_profile",
943   "Koha::Schema::Result::HouseboundProfile",
944   { "foreign.borrowernumber" => "self.borrowernumber" },
945   { cascade_copy => 0, cascade_delete => 0 },
946 );
947
948 =head2 housebound_role
949
950 Type: might_have
951
952 Related object: L<Koha::Schema::Result::HouseboundRole>
953
954 =cut
955
956 __PACKAGE__->might_have(
957   "housebound_role",
958   "Koha::Schema::Result::HouseboundRole",
959   { "foreign.borrowernumber_id" => "self.borrowernumber" },
960   { cascade_copy => 0, cascade_delete => 0 },
961 );
962
963 =head2 housebound_visit_chooser_brwnumbers
964
965 Type: has_many
966
967 Related object: L<Koha::Schema::Result::HouseboundVisit>
968
969 =cut
970
971 __PACKAGE__->has_many(
972   "housebound_visit_chooser_brwnumbers",
973   "Koha::Schema::Result::HouseboundVisit",
974   { "foreign.chooser_brwnumber" => "self.borrowernumber" },
975   { cascade_copy => 0, cascade_delete => 0 },
976 );
977
978 =head2 housebound_visit_deliverer_brwnumbers
979
980 Type: has_many
981
982 Related object: L<Koha::Schema::Result::HouseboundVisit>
983
984 =cut
985
986 __PACKAGE__->has_many(
987   "housebound_visit_deliverer_brwnumbers",
988   "Koha::Schema::Result::HouseboundVisit",
989   { "foreign.deliverer_brwnumber" => "self.borrowernumber" },
990   { cascade_copy => 0, cascade_delete => 0 },
991 );
992
993 =head2 issues
994
995 Type: has_many
996
997 Related object: L<Koha::Schema::Result::Issue>
998
999 =cut
1000
1001 __PACKAGE__->has_many(
1002   "issues",
1003   "Koha::Schema::Result::Issue",
1004   { "foreign.borrowernumber" => "self.borrowernumber" },
1005   { cascade_copy => 0, cascade_delete => 0 },
1006 );
1007
1008 =head2 items_last_borrowers
1009
1010 Type: has_many
1011
1012 Related object: L<Koha::Schema::Result::ItemsLastBorrower>
1013
1014 =cut
1015
1016 __PACKAGE__->has_many(
1017   "items_last_borrowers",
1018   "Koha::Schema::Result::ItemsLastBorrower",
1019   { "foreign.borrowernumber" => "self.borrowernumber" },
1020   { cascade_copy => 0, cascade_delete => 0 },
1021 );
1022
1023 =head2 message_queues
1024
1025 Type: has_many
1026
1027 Related object: L<Koha::Schema::Result::MessageQueue>
1028
1029 =cut
1030
1031 __PACKAGE__->has_many(
1032   "message_queues",
1033   "Koha::Schema::Result::MessageQueue",
1034   { "foreign.borrowernumber" => "self.borrowernumber" },
1035   { cascade_copy => 0, cascade_delete => 0 },
1036 );
1037
1038 =head2 messages
1039
1040 Type: has_many
1041
1042 Related object: L<Koha::Schema::Result::Message>
1043
1044 =cut
1045
1046 __PACKAGE__->has_many(
1047   "messages",
1048   "Koha::Schema::Result::Message",
1049   { "foreign.manager_id" => "self.borrowernumber" },
1050   { cascade_copy => 0, cascade_delete => 0 },
1051 );
1052
1053 =head2 old_issues
1054
1055 Type: has_many
1056
1057 Related object: L<Koha::Schema::Result::OldIssue>
1058
1059 =cut
1060
1061 __PACKAGE__->has_many(
1062   "old_issues",
1063   "Koha::Schema::Result::OldIssue",
1064   { "foreign.borrowernumber" => "self.borrowernumber" },
1065   { cascade_copy => 0, cascade_delete => 0 },
1066 );
1067
1068 =head2 old_reserves
1069
1070 Type: has_many
1071
1072 Related object: L<Koha::Schema::Result::OldReserve>
1073
1074 =cut
1075
1076 __PACKAGE__->has_many(
1077   "old_reserves",
1078   "Koha::Schema::Result::OldReserve",
1079   { "foreign.borrowernumber" => "self.borrowernumber" },
1080   { cascade_copy => 0, cascade_delete => 0 },
1081 );
1082
1083 =head2 opac_news
1084
1085 Type: has_many
1086
1087 Related object: L<Koha::Schema::Result::OpacNews>
1088
1089 =cut
1090
1091 __PACKAGE__->has_many(
1092   "opac_news",
1093   "Koha::Schema::Result::OpacNews",
1094   { "foreign.borrowernumber" => "self.borrowernumber" },
1095   { cascade_copy => 0, cascade_delete => 0 },
1096 );
1097
1098 =head2 patron_list_patrons
1099
1100 Type: has_many
1101
1102 Related object: L<Koha::Schema::Result::PatronListPatron>
1103
1104 =cut
1105
1106 __PACKAGE__->has_many(
1107   "patron_list_patrons",
1108   "Koha::Schema::Result::PatronListPatron",
1109   { "foreign.borrowernumber" => "self.borrowernumber" },
1110   { cascade_copy => 0, cascade_delete => 0 },
1111 );
1112
1113 =head2 patron_lists
1114
1115 Type: has_many
1116
1117 Related object: L<Koha::Schema::Result::PatronList>
1118
1119 =cut
1120
1121 __PACKAGE__->has_many(
1122   "patron_lists",
1123   "Koha::Schema::Result::PatronList",
1124   { "foreign.owner" => "self.borrowernumber" },
1125   { cascade_copy => 0, cascade_delete => 0 },
1126 );
1127
1128 =head2 patronimage
1129
1130 Type: might_have
1131
1132 Related object: L<Koha::Schema::Result::Patronimage>
1133
1134 =cut
1135
1136 __PACKAGE__->might_have(
1137   "patronimage",
1138   "Koha::Schema::Result::Patronimage",
1139   { "foreign.borrowernumber" => "self.borrowernumber" },
1140   { cascade_copy => 0, cascade_delete => 0 },
1141 );
1142
1143 =head2 ratings
1144
1145 Type: has_many
1146
1147 Related object: L<Koha::Schema::Result::Rating>
1148
1149 =cut
1150
1151 __PACKAGE__->has_many(
1152   "ratings",
1153   "Koha::Schema::Result::Rating",
1154   { "foreign.borrowernumber" => "self.borrowernumber" },
1155   { cascade_copy => 0, cascade_delete => 0 },
1156 );
1157
1158 =head2 reserves
1159
1160 Type: has_many
1161
1162 Related object: L<Koha::Schema::Result::Reserve>
1163
1164 =cut
1165
1166 __PACKAGE__->has_many(
1167   "reserves",
1168   "Koha::Schema::Result::Reserve",
1169   { "foreign.borrowernumber" => "self.borrowernumber" },
1170   { cascade_copy => 0, cascade_delete => 0 },
1171 );
1172
1173 =head2 reviews
1174
1175 Type: has_many
1176
1177 Related object: L<Koha::Schema::Result::Review>
1178
1179 =cut
1180
1181 __PACKAGE__->has_many(
1182   "reviews",
1183   "Koha::Schema::Result::Review",
1184   { "foreign.borrowernumber" => "self.borrowernumber" },
1185   { cascade_copy => 0, cascade_delete => 0 },
1186 );
1187
1188 =head2 sms_provider
1189
1190 Type: belongs_to
1191
1192 Related object: L<Koha::Schema::Result::SmsProvider>
1193
1194 =cut
1195
1196 __PACKAGE__->belongs_to(
1197   "sms_provider",
1198   "Koha::Schema::Result::SmsProvider",
1199   { id => "sms_provider_id" },
1200   {
1201     is_deferrable => 1,
1202     join_type     => "LEFT",
1203     on_delete     => "SET NULL",
1204     on_update     => "CASCADE",
1205   },
1206 );
1207
1208 =head2 subscriptionroutinglists
1209
1210 Type: has_many
1211
1212 Related object: L<Koha::Schema::Result::Subscriptionroutinglist>
1213
1214 =cut
1215
1216 __PACKAGE__->has_many(
1217   "subscriptionroutinglists",
1218   "Koha::Schema::Result::Subscriptionroutinglist",
1219   { "foreign.borrowernumber" => "self.borrowernumber" },
1220   { cascade_copy => 0, cascade_delete => 0 },
1221 );
1222
1223 =head2 tags_all
1224
1225 Type: has_many
1226
1227 Related object: L<Koha::Schema::Result::TagAll>
1228
1229 =cut
1230
1231 __PACKAGE__->has_many(
1232   "tags_all",
1233   "Koha::Schema::Result::TagAll",
1234   { "foreign.borrowernumber" => "self.borrowernumber" },
1235   { cascade_copy => 0, cascade_delete => 0 },
1236 );
1237
1238 =head2 tags_approvals
1239
1240 Type: has_many
1241
1242 Related object: L<Koha::Schema::Result::TagsApproval>
1243
1244 =cut
1245
1246 __PACKAGE__->has_many(
1247   "tags_approvals",
1248   "Koha::Schema::Result::TagsApproval",
1249   { "foreign.approved_by" => "self.borrowernumber" },
1250   { cascade_copy => 0, cascade_delete => 0 },
1251 );
1252
1253 =head2 user_permissions
1254
1255 Type: has_many
1256
1257 Related object: L<Koha::Schema::Result::UserPermission>
1258
1259 =cut
1260
1261 __PACKAGE__->has_many(
1262   "user_permissions",
1263   "Koha::Schema::Result::UserPermission",
1264   { "foreign.borrowernumber" => "self.borrowernumber" },
1265   { cascade_copy => 0, cascade_delete => 0 },
1266 );
1267
1268 =head2 virtualshelfcontents
1269
1270 Type: has_many
1271
1272 Related object: L<Koha::Schema::Result::Virtualshelfcontent>
1273
1274 =cut
1275
1276 __PACKAGE__->has_many(
1277   "virtualshelfcontents",
1278   "Koha::Schema::Result::Virtualshelfcontent",
1279   { "foreign.borrowernumber" => "self.borrowernumber" },
1280   { cascade_copy => 0, cascade_delete => 0 },
1281 );
1282
1283 =head2 virtualshelfshares
1284
1285 Type: has_many
1286
1287 Related object: L<Koha::Schema::Result::Virtualshelfshare>
1288
1289 =cut
1290
1291 __PACKAGE__->has_many(
1292   "virtualshelfshares",
1293   "Koha::Schema::Result::Virtualshelfshare",
1294   { "foreign.borrowernumber" => "self.borrowernumber" },
1295   { cascade_copy => 0, cascade_delete => 0 },
1296 );
1297
1298 =head2 virtualshelves
1299
1300 Type: has_many
1301
1302 Related object: L<Koha::Schema::Result::Virtualshelve>
1303
1304 =cut
1305
1306 __PACKAGE__->has_many(
1307   "virtualshelves",
1308   "Koha::Schema::Result::Virtualshelve",
1309   { "foreign.owner" => "self.borrowernumber" },
1310   { cascade_copy => 0, cascade_delete => 0 },
1311 );
1312
1313 =head2 basketnoes
1314
1315 Type: many_to_many
1316
1317 Composing rels: L</aqbasketusers> -> basketno
1318
1319 =cut
1320
1321 __PACKAGE__->many_to_many("basketnoes", "aqbasketusers", "basketno");
1322
1323 =head2 budgets
1324
1325 Type: many_to_many
1326
1327 Composing rels: L</aqbudgetborrowers> -> budget
1328
1329 =cut
1330
1331 __PACKAGE__->many_to_many("budgets", "aqbudgetborrowers", "budget");
1332
1333 =head2 courses
1334
1335 Type: many_to_many
1336
1337 Composing rels: L</course_instructors> -> course
1338
1339 =cut
1340
1341 __PACKAGE__->many_to_many("courses", "course_instructors", "course");
1342
1343 =head2 ordernumbers
1344
1345 Type: many_to_many
1346
1347 Composing rels: L</aqorder_users> -> ordernumber
1348
1349 =cut
1350
1351 __PACKAGE__->many_to_many("ordernumbers", "aqorder_users", "ordernumber");
1352
1353
1354 # Created by DBIx::Class::Schema::Loader v0.07042 @ 2016-10-31 10:39:35
1355 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Lc6GQ2E7d+tyzTk3v2sWjQ
1356
1357 __PACKAGE__->belongs_to(
1358     "guarantor",
1359     "Koha::Schema::Result::Borrower",
1360     { borrowernumber => "guarantorid" },
1361 );
1362
1363 __PACKAGE__->add_columns(
1364     '+lost' => { is_boolean => 1 },
1365     '+gonenoaddress' => { is_boolean => 1 }
1366 );
1367
1368 sub koha_objects_class {
1369     'Koha::Patrons';
1370 }
1371
1372 1;