|
Lines 1-12
Link Here
|
| 1 |
use utf8; |
1 |
use utf8; |
| 2 |
package Koha::Schema::Result::OpacNews; |
2 |
package Koha::Schema::Result::AdditionalContent; |
| 3 |
|
3 |
|
| 4 |
# Created by DBIx::Class::Schema::Loader |
4 |
# Created by DBIx::Class::Schema::Loader |
| 5 |
# DO NOT MODIFY THE FIRST PART OF THIS FILE |
5 |
# DO NOT MODIFY THE FIRST PART OF THIS FILE |
| 6 |
|
6 |
|
| 7 |
=head1 NAME |
7 |
=head1 NAME |
| 8 |
|
8 |
|
| 9 |
Koha::Schema::Result::OpacNews |
9 |
Koha::Schema::Result::AdditionalContent |
| 10 |
|
10 |
|
| 11 |
=cut |
11 |
=cut |
| 12 |
|
12 |
|
|
Lines 15-25
use warnings;
Link Here
|
| 15 |
|
15 |
|
| 16 |
use base 'DBIx::Class::Core'; |
16 |
use base 'DBIx::Class::Core'; |
| 17 |
|
17 |
|
| 18 |
=head1 TABLE: C<opac_news> |
18 |
=head1 TABLE: C<additional_contents> |
| 19 |
|
19 |
|
| 20 |
=cut |
20 |
=cut |
| 21 |
|
21 |
|
| 22 |
__PACKAGE__->table("opac_news"); |
22 |
__PACKAGE__->table("additional_contents"); |
| 23 |
|
23 |
|
| 24 |
=head1 ACCESSORS |
24 |
=head1 ACCESSORS |
| 25 |
|
25 |
|
|
Lines 30-36
__PACKAGE__->table("opac_news");
Link Here
|
| 30 |
is_auto_increment: 1 |
30 |
is_auto_increment: 1 |
| 31 |
is_nullable: 0 |
31 |
is_nullable: 0 |
| 32 |
|
32 |
|
| 33 |
unique identifier for the news article |
33 |
unique identifier for the additional content |
|
|
34 |
|
| 35 |
=head2 category |
| 36 |
|
| 37 |
data_type: 'varchar' |
| 38 |
is_nullable: 0 |
| 39 |
size: 20 |
| 40 |
|
| 41 |
category for the additional content |
| 42 |
|
| 43 |
=head2 code |
| 44 |
|
| 45 |
data_type: 'varchar' |
| 46 |
is_nullable: 0 |
| 47 |
size: 20 |
| 48 |
|
| 49 |
code to group content per lang |
| 50 |
|
| 51 |
=head2 location |
| 52 |
|
| 53 |
data_type: 'varchar' |
| 54 |
is_nullable: 0 |
| 55 |
size: 255 |
| 56 |
|
| 57 |
location of the additional content |
| 34 |
|
58 |
|
| 35 |
=head2 branchcode |
59 |
=head2 branchcode |
| 36 |
|
60 |
|
|
Lines 39-45
unique identifier for the news article
Link Here
|
| 39 |
is_nullable: 1 |
63 |
is_nullable: 1 |
| 40 |
size: 10 |
64 |
size: 10 |
| 41 |
|
65 |
|
| 42 |
branch code users to create branch specific news, NULL is every branch. |
66 |
branch code users to create branch specific additional content, NULL is every branch. |
| 43 |
|
67 |
|
| 44 |
=head2 title |
68 |
=head2 title |
| 45 |
|
69 |
|
|
Lines 48-70
branch code users to create branch specific news, NULL is every branch.
Link Here
|
| 48 |
is_nullable: 0 |
72 |
is_nullable: 0 |
| 49 |
size: 250 |
73 |
size: 250 |
| 50 |
|
74 |
|
| 51 |
title of the news article |
75 |
title of the additional content |
| 52 |
|
76 |
|
| 53 |
=head2 content |
77 |
=head2 content |
| 54 |
|
78 |
|
| 55 |
data_type: 'mediumtext' |
79 |
data_type: 'mediumtext' |
| 56 |
is_nullable: 0 |
80 |
is_nullable: 0 |
| 57 |
|
81 |
|
| 58 |
the body of your news article |
82 |
the body of your additional content |
| 59 |
|
83 |
|
| 60 |
=head2 lang |
84 |
=head2 lang |
| 61 |
|
85 |
|
| 62 |
data_type: 'varchar' |
86 |
data_type: 'varchar' |
| 63 |
default_value: (empty string) |
87 |
default_value: (empty string) |
| 64 |
is_nullable: 0 |
88 |
is_nullable: 0 |
| 65 |
size: 50 |
89 |
size: 25 |
| 66 |
|
90 |
|
| 67 |
location for the article (koha is the staff interface, slip is the circulation receipt and language codes are for the opac) |
91 |
location for the additional content(koha is the staff interface, slip is the circulation receipt and language codes are for the opac) |
| 68 |
|
92 |
|
| 69 |
=head2 published_on |
93 |
=head2 published_on |
| 70 |
|
94 |
|
|
Lines 89-102
last modification
Link Here
|
| 89 |
datetime_undef_if_invalid: 1 |
113 |
datetime_undef_if_invalid: 1 |
| 90 |
is_nullable: 1 |
114 |
is_nullable: 1 |
| 91 |
|
115 |
|
| 92 |
date the article is set to expire or no longer be visible |
116 |
date the additional content is set to expire or no longer be visible |
| 93 |
|
117 |
|
| 94 |
=head2 number |
118 |
=head2 number |
| 95 |
|
119 |
|
| 96 |
data_type: 'integer' |
120 |
data_type: 'integer' |
| 97 |
is_nullable: 1 |
121 |
is_nullable: 1 |
| 98 |
|
122 |
|
| 99 |
the order in which this article appears in that specific location |
123 |
the order in which this additional content appears in that specific location |
| 100 |
|
124 |
|
| 101 |
=head2 borrowernumber |
125 |
=head2 borrowernumber |
| 102 |
|
126 |
|
|
Lines 104-110
the order in which this article appears in that specific location
Link Here
|
| 104 |
is_foreign_key: 1 |
128 |
is_foreign_key: 1 |
| 105 |
is_nullable: 1 |
129 |
is_nullable: 1 |
| 106 |
|
130 |
|
| 107 |
The user who created the news article |
131 |
The user who created the additional content |
| 108 |
|
132 |
|
| 109 |
=cut |
133 |
=cut |
| 110 |
|
134 |
|
|
Lines 116-121
__PACKAGE__->add_columns(
Link Here
|
| 116 |
is_auto_increment => 1, |
140 |
is_auto_increment => 1, |
| 117 |
is_nullable => 0, |
141 |
is_nullable => 0, |
| 118 |
}, |
142 |
}, |
|
|
143 |
"category", |
| 144 |
{ data_type => "varchar", is_nullable => 0, size => 20 }, |
| 145 |
"code", |
| 146 |
{ data_type => "varchar", is_nullable => 0, size => 20 }, |
| 147 |
"location", |
| 148 |
{ data_type => "varchar", is_nullable => 0, size => 255 }, |
| 119 |
"branchcode", |
149 |
"branchcode", |
| 120 |
{ data_type => "varchar", is_foreign_key => 1, is_nullable => 1, size => 10 }, |
150 |
{ data_type => "varchar", is_foreign_key => 1, is_nullable => 1, size => 10 }, |
| 121 |
"title", |
151 |
"title", |
|
Lines 123-129
__PACKAGE__->add_columns(
Link Here
|
| 123 |
"content", |
153 |
"content", |
| 124 |
{ data_type => "mediumtext", is_nullable => 0 }, |
154 |
{ data_type => "mediumtext", is_nullable => 0 }, |
| 125 |
"lang", |
155 |
"lang", |
| 126 |
{ data_type => "varchar", default_value => "", is_nullable => 0, size => 50 }, |
156 |
{ data_type => "varchar", default_value => "", is_nullable => 0, size => 25 }, |
| 127 |
"published_on", |
157 |
"published_on", |
| 128 |
{ data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 }, |
158 |
{ data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 }, |
| 129 |
"updated_on", |
159 |
"updated_on", |
|
Lines 153-158
__PACKAGE__->add_columns(
Link Here
|
| 153 |
|
183 |
|
| 154 |
__PACKAGE__->set_primary_key("idnew"); |
184 |
__PACKAGE__->set_primary_key("idnew"); |
| 155 |
|
185 |
|
|
|
186 |
=head1 UNIQUE CONSTRAINTS |
| 187 |
|
| 188 |
=head2 C<additional_contents_uniq> |
| 189 |
|
| 190 |
=over 4 |
| 191 |
|
| 192 |
=item * L</category> |
| 193 |
|
| 194 |
=item * L</code> |
| 195 |
|
| 196 |
=item * L</branchcode> |
| 197 |
|
| 198 |
=item * L</lang> |
| 199 |
|
| 200 |
=back |
| 201 |
|
| 202 |
=cut |
| 203 |
|
| 204 |
__PACKAGE__->add_unique_constraint( |
| 205 |
"additional_contents_uniq", |
| 206 |
["category", "code", "branchcode", "lang"], |
| 207 |
); |
| 208 |
|
| 156 |
=head1 RELATIONS |
209 |
=head1 RELATIONS |
| 157 |
|
210 |
|
| 158 |
=head2 borrowernumber |
211 |
=head2 borrowernumber |
|
Lines 196-209
__PACKAGE__->belongs_to(
Link Here
|
| 196 |
); |
249 |
); |
| 197 |
|
250 |
|
| 198 |
|
251 |
|
| 199 |
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-01-21 13:39:29 |
252 |
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-07-07 13:15:32 |
| 200 |
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Edd8K7ANL49fG7FKjwyRVQ |
253 |
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:rq0r36nBQ3k0EfbpjzpVUw |
| 201 |
|
254 |
|
| 202 |
sub koha_object_class { |
|
|
| 203 |
'Koha::NewsItem'; |
| 204 |
} |
| 205 |
sub koha_objects_class { |
| 206 |
'Koha::News'; |
| 207 |
} |
| 208 |
|
255 |
|
|
|
256 |
# You can replace this text with custom code or comments, and it will be preserved on regeneration |
| 209 |
1; |
257 |
1; |