Bug 23152: Implement koha_object[s]_class when needed
[koha-equinox.git] / Koha / Schema / Result / OpacNews.pm
1 use utf8;
2 package Koha::Schema::Result::OpacNews;
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::OpacNews
10
11 =cut
12
13 use strict;
14 use warnings;
15
16 use base 'DBIx::Class::Core';
17
18 =head1 TABLE: C<opac_news>
19
20 =cut
21
22 __PACKAGE__->table("opac_news");
23
24 =head1 ACCESSORS
25
26 =head2 idnew
27
28   data_type: 'integer'
29   extra: {unsigned => 1}
30   is_auto_increment: 1
31   is_nullable: 0
32
33 =head2 branchcode
34
35   data_type: 'varchar'
36   is_foreign_key: 1
37   is_nullable: 1
38   size: 10
39
40 =head2 title
41
42   data_type: 'varchar'
43   default_value: (empty string)
44   is_nullable: 0
45   size: 250
46
47 =head2 content
48
49   data_type: 'mediumtext'
50   is_nullable: 0
51
52 =head2 lang
53
54   data_type: 'varchar'
55   default_value: (empty string)
56   is_nullable: 0
57   size: 25
58
59 =head2 timestamp
60
61   data_type: 'timestamp'
62   datetime_undef_if_invalid: 1
63   default_value: current_timestamp
64   is_nullable: 0
65
66 =head2 expirationdate
67
68   data_type: 'date'
69   datetime_undef_if_invalid: 1
70   is_nullable: 1
71
72 =head2 number
73
74   data_type: 'integer'
75   is_nullable: 1
76
77 =head2 borrowernumber
78
79   data_type: 'integer'
80   is_foreign_key: 1
81   is_nullable: 1
82
83 =cut
84
85 __PACKAGE__->add_columns(
86   "idnew",
87   {
88     data_type => "integer",
89     extra => { unsigned => 1 },
90     is_auto_increment => 1,
91     is_nullable => 0,
92   },
93   "branchcode",
94   { data_type => "varchar", is_foreign_key => 1, is_nullable => 1, size => 10 },
95   "title",
96   { data_type => "varchar", default_value => "", is_nullable => 0, size => 250 },
97   "content",
98   { data_type => "mediumtext", is_nullable => 0 },
99   "lang",
100   { data_type => "varchar", default_value => "", is_nullable => 0, size => 25 },
101   "timestamp",
102   {
103     data_type => "timestamp",
104     datetime_undef_if_invalid => 1,
105     default_value => \"current_timestamp",
106     is_nullable => 0,
107   },
108   "expirationdate",
109   { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
110   "number",
111   { data_type => "integer", is_nullable => 1 },
112   "borrowernumber",
113   { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
114 );
115
116 =head1 PRIMARY KEY
117
118 =over 4
119
120 =item * L</idnew>
121
122 =back
123
124 =cut
125
126 __PACKAGE__->set_primary_key("idnew");
127
128 =head1 RELATIONS
129
130 =head2 borrowernumber
131
132 Type: belongs_to
133
134 Related object: L<Koha::Schema::Result::Borrower>
135
136 =cut
137
138 __PACKAGE__->belongs_to(
139   "borrowernumber",
140   "Koha::Schema::Result::Borrower",
141   { borrowernumber => "borrowernumber" },
142   {
143     is_deferrable => 1,
144     join_type     => "LEFT",
145     on_delete     => "SET NULL",
146     on_update     => "CASCADE",
147   },
148 );
149
150 =head2 branchcode
151
152 Type: belongs_to
153
154 Related object: L<Koha::Schema::Result::Branch>
155
156 =cut
157
158 __PACKAGE__->belongs_to(
159   "branchcode",
160   "Koha::Schema::Result::Branch",
161   { branchcode => "branchcode" },
162   {
163     is_deferrable => 1,
164     join_type     => "LEFT",
165     on_delete     => "CASCADE",
166     on_update     => "CASCADE",
167   },
168 );
169
170
171 # Created by DBIx::Class::Schema::Loader v0.07042 @ 2018-02-16 17:54:54
172 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:gApTRM/dF6uZSMYyvkt4OQ
173
174 sub koha_object_class {
175     'Koha::NewsItem';
176 }
177 sub koha_objects_class {
178     'Koha::NewsItems';
179 }
180
181 1;