Bug 23152: Implement koha_object[s]_class when needed
[koha-equinox.git] / Koha / Schema / Result / ClubEnrollment.pm
1 use utf8;
2 package Koha::Schema::Result::ClubEnrollment;
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::ClubEnrollment
10
11 =cut
12
13 use strict;
14 use warnings;
15
16 use base 'DBIx::Class::Core';
17
18 =head1 TABLE: C<club_enrollments>
19
20 =cut
21
22 __PACKAGE__->table("club_enrollments");
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 club_id
33
34   data_type: 'integer'
35   is_foreign_key: 1
36   is_nullable: 0
37
38 =head2 borrowernumber
39
40   data_type: 'integer'
41   is_foreign_key: 1
42   is_nullable: 0
43
44 =head2 date_enrolled
45
46   data_type: 'timestamp'
47   datetime_undef_if_invalid: 1
48   default_value: current_timestamp
49   is_nullable: 0
50
51 =head2 date_canceled
52
53   data_type: 'timestamp'
54   datetime_undef_if_invalid: 1
55   is_nullable: 1
56
57 =head2 date_created
58
59   data_type: 'timestamp'
60   datetime_undef_if_invalid: 1
61   is_nullable: 1
62
63 =head2 date_updated
64
65   data_type: 'timestamp'
66   datetime_undef_if_invalid: 1
67   is_nullable: 1
68
69 =head2 branchcode
70
71   data_type: 'varchar'
72   is_foreign_key: 1
73   is_nullable: 1
74   size: 10
75
76 =cut
77
78 __PACKAGE__->add_columns(
79   "id",
80   { data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
81   "club_id",
82   { data_type => "integer", is_foreign_key => 1, is_nullable => 0 },
83   "borrowernumber",
84   { data_type => "integer", is_foreign_key => 1, is_nullable => 0 },
85   "date_enrolled",
86   {
87     data_type => "timestamp",
88     datetime_undef_if_invalid => 1,
89     default_value => \"current_timestamp",
90     is_nullable => 0,
91   },
92   "date_canceled",
93   {
94     data_type => "timestamp",
95     datetime_undef_if_invalid => 1,
96     is_nullable => 1,
97   },
98   "date_created",
99   {
100     data_type => "timestamp",
101     datetime_undef_if_invalid => 1,
102     is_nullable => 1,
103   },
104   "date_updated",
105   {
106     data_type => "timestamp",
107     datetime_undef_if_invalid => 1,
108     is_nullable => 1,
109   },
110   "branchcode",
111   { data_type => "varchar", is_foreign_key => 1, is_nullable => 1, size => 10 },
112 );
113
114 =head1 PRIMARY KEY
115
116 =over 4
117
118 =item * L</id>
119
120 =back
121
122 =cut
123
124 __PACKAGE__->set_primary_key("id");
125
126 =head1 RELATIONS
127
128 =head2 borrowernumber
129
130 Type: belongs_to
131
132 Related object: L<Koha::Schema::Result::Borrower>
133
134 =cut
135
136 __PACKAGE__->belongs_to(
137   "borrowernumber",
138   "Koha::Schema::Result::Borrower",
139   { borrowernumber => "borrowernumber" },
140   { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
141 );
142
143 =head2 branchcode
144
145 Type: belongs_to
146
147 Related object: L<Koha::Schema::Result::Branch>
148
149 =cut
150
151 __PACKAGE__->belongs_to(
152   "branchcode",
153   "Koha::Schema::Result::Branch",
154   { branchcode => "branchcode" },
155   {
156     is_deferrable => 1,
157     join_type     => "LEFT",
158     on_delete     => "SET NULL",
159     on_update     => "CASCADE",
160   },
161 );
162
163 =head2 club
164
165 Type: belongs_to
166
167 Related object: L<Koha::Schema::Result::Club>
168
169 =cut
170
171 __PACKAGE__->belongs_to(
172   "club",
173   "Koha::Schema::Result::Club",
174   { id => "club_id" },
175   { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
176 );
177
178 =head2 club_enrollment_fields
179
180 Type: has_many
181
182 Related object: L<Koha::Schema::Result::ClubEnrollmentField>
183
184 =cut
185
186 __PACKAGE__->has_many(
187   "club_enrollment_fields",
188   "Koha::Schema::Result::ClubEnrollmentField",
189   { "foreign.club_enrollment_id" => "self.id" },
190   { cascade_copy => 0, cascade_delete => 0 },
191 );
192
193
194 # Created by DBIx::Class::Schema::Loader v0.07042 @ 2018-02-12 17:59:47
195 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Ih/HQM4KIRDZ0ESXVR9FwA
196
197 sub koha_object_class {
198     'Koha::Club::Enrollment';
199 }
200 sub koha_objects_class {
201     'Koha::Club::Enrollments';
202 }
203
204 1;