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