Bug 32257: Label for patron attributes misaligned
[koha-ffzg.git] / Koha / Schema / Result / Letter.pm
1 use utf8;
2 package Koha::Schema::Result::Letter;
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::Letter
10
11 =cut
12
13 use strict;
14 use warnings;
15
16 use base 'DBIx::Class::Core';
17
18 =head1 TABLE: C<letter>
19
20 =cut
21
22 __PACKAGE__->table("letter");
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 identifier
33
34 =head2 module
35
36   data_type: 'varchar'
37   default_value: (empty string)
38   is_nullable: 0
39   size: 20
40
41 Koha module that triggers this notice or slip
42
43 =head2 code
44
45   data_type: 'varchar'
46   default_value: (empty string)
47   is_nullable: 0
48   size: 20
49
50 unique identifier for this notice or slip
51
52 =head2 branchcode
53
54   data_type: 'varchar'
55   default_value: (empty string)
56   is_nullable: 0
57   size: 10
58
59 the branch this notice or slip is used at (branches.branchcode)
60
61 =head2 name
62
63   data_type: 'varchar'
64   default_value: (empty string)
65   is_nullable: 0
66   size: 100
67
68 plain text name for this notice or slip
69
70 =head2 is_html
71
72   data_type: 'tinyint'
73   default_value: 0
74   is_nullable: 1
75
76 does this notice or slip use HTML (1 for yes, 0 for no)
77
78 =head2 title
79
80   data_type: 'varchar'
81   default_value: (empty string)
82   is_nullable: 0
83   size: 200
84
85 subject line of the notice
86
87 =head2 content
88
89   data_type: 'mediumtext'
90   is_nullable: 1
91
92 body text for the notice or slip
93
94 =head2 message_transport_type
95
96   data_type: 'varchar'
97   default_value: 'email'
98   is_foreign_key: 1
99   is_nullable: 0
100   size: 20
101
102 transport type for this notice
103
104 =head2 lang
105
106   data_type: 'varchar'
107   default_value: 'default'
108   is_nullable: 0
109   size: 25
110
111 lang of the notice
112
113 =head2 updated_on
114
115   data_type: 'timestamp'
116   datetime_undef_if_invalid: 1
117   default_value: current_timestamp
118   is_nullable: 0
119
120 last modification
121
122 =cut
123
124 __PACKAGE__->add_columns(
125   "id",
126   { data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
127   "module",
128   { data_type => "varchar", default_value => "", is_nullable => 0, size => 20 },
129   "code",
130   { data_type => "varchar", default_value => "", is_nullable => 0, size => 20 },
131   "branchcode",
132   { data_type => "varchar", default_value => "", is_nullable => 0, size => 10 },
133   "name",
134   { data_type => "varchar", default_value => "", is_nullable => 0, size => 100 },
135   "is_html",
136   { data_type => "tinyint", default_value => 0, is_nullable => 1 },
137   "title",
138   { data_type => "varchar", default_value => "", is_nullable => 0, size => 200 },
139   "content",
140   { data_type => "mediumtext", is_nullable => 1 },
141   "message_transport_type",
142   {
143     data_type => "varchar",
144     default_value => "email",
145     is_foreign_key => 1,
146     is_nullable => 0,
147     size => 20,
148   },
149   "lang",
150   {
151     data_type => "varchar",
152     default_value => "default",
153     is_nullable => 0,
154     size => 25,
155   },
156   "updated_on",
157   {
158     data_type => "timestamp",
159     datetime_undef_if_invalid => 1,
160     default_value => \"current_timestamp",
161     is_nullable => 0,
162   },
163 );
164
165 =head1 PRIMARY KEY
166
167 =over 4
168
169 =item * L</id>
170
171 =back
172
173 =cut
174
175 __PACKAGE__->set_primary_key("id");
176
177 =head1 UNIQUE CONSTRAINTS
178
179 =head2 C<letter_uniq_1>
180
181 =over 4
182
183 =item * L</module>
184
185 =item * L</code>
186
187 =item * L</branchcode>
188
189 =item * L</message_transport_type>
190
191 =item * L</lang>
192
193 =back
194
195 =cut
196
197 __PACKAGE__->add_unique_constraint(
198   "letter_uniq_1",
199   ["module", "code", "branchcode", "message_transport_type", "lang"],
200 );
201
202 =head1 RELATIONS
203
204 =head2 message_queues
205
206 Type: has_many
207
208 Related object: L<Koha::Schema::Result::MessageQueue>
209
210 =cut
211
212 __PACKAGE__->has_many(
213   "message_queues",
214   "Koha::Schema::Result::MessageQueue",
215   { "foreign.letter_id" => "self.id" },
216   { cascade_copy => 0, cascade_delete => 0 },
217 );
218
219 =head2 message_transport_type
220
221 Type: belongs_to
222
223 Related object: L<Koha::Schema::Result::MessageTransportType>
224
225 =cut
226
227 __PACKAGE__->belongs_to(
228   "message_transport_type",
229   "Koha::Schema::Result::MessageTransportType",
230   { message_transport_type => "message_transport_type" },
231   { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
232 );
233
234
235 # Created by DBIx::Class::Schema::Loader v0.07049 @ 2022-10-18 12:50:14
236 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:MA3WvXK/1ZBc407iU7ZcrA
237
238 sub koha_object_class {
239     'Koha::Notice::Template';
240 }
241 sub koha_objects_class {
242     'Koha::Notice::Templates';
243 }
244
245 1;