Bug 32257: Label for patron attributes misaligned
[koha-ffzg.git] / Koha / Schema / Result / Virtualshelve.pm
1 use utf8;
2 package Koha::Schema::Result::Virtualshelve;
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::Virtualshelve
10
11 =cut
12
13 use strict;
14 use warnings;
15
16 use base 'DBIx::Class::Core';
17
18 =head1 TABLE: C<virtualshelves>
19
20 =cut
21
22 __PACKAGE__->table("virtualshelves");
23
24 =head1 ACCESSORS
25
26 =head2 shelfnumber
27
28   data_type: 'integer'
29   is_auto_increment: 1
30   is_nullable: 0
31
32 unique identifier assigned by Koha
33
34 =head2 shelfname
35
36   data_type: 'varchar'
37   is_nullable: 1
38   size: 255
39
40 name of the list
41
42 =head2 owner
43
44   data_type: 'integer'
45   is_foreign_key: 1
46   is_nullable: 1
47
48 foreign key linking to the borrowers table (using borrowernumber) for the creator of this list (changed from varchar(80) to int)
49
50 =head2 public
51
52   data_type: 'tinyint'
53   default_value: 0
54   is_nullable: 0
55
56 If the list is public
57
58 =head2 sortfield
59
60   data_type: 'varchar'
61   default_value: 'title'
62   is_nullable: 1
63   size: 16
64
65 the field this list is sorted on
66
67 =head2 lastmodified
68
69   data_type: 'timestamp'
70   datetime_undef_if_invalid: 1
71   default_value: current_timestamp
72   is_nullable: 0
73
74 date and time the list was last modified
75
76 =head2 created_on
77
78   data_type: 'datetime'
79   datetime_undef_if_invalid: 1
80   is_nullable: 0
81
82 creation time
83
84 =head2 allow_change_from_owner
85
86   data_type: 'tinyint'
87   default_value: 1
88   is_nullable: 1
89
90 can owner change contents?
91
92 =head2 allow_change_from_others
93
94   data_type: 'tinyint'
95   default_value: 0
96   is_nullable: 1
97
98 can others change contents?
99
100 =head2 allow_change_from_staff
101
102   data_type: 'tinyint'
103   default_value: 0
104   is_nullable: 1
105
106 can staff change contents?
107
108 =cut
109
110 __PACKAGE__->add_columns(
111   "shelfnumber",
112   { data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
113   "shelfname",
114   { data_type => "varchar", is_nullable => 1, size => 255 },
115   "owner",
116   { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
117   "public",
118   { data_type => "tinyint", default_value => 0, is_nullable => 0 },
119   "sortfield",
120   {
121     data_type => "varchar",
122     default_value => "title",
123     is_nullable => 1,
124     size => 16,
125   },
126   "lastmodified",
127   {
128     data_type => "timestamp",
129     datetime_undef_if_invalid => 1,
130     default_value => \"current_timestamp",
131     is_nullable => 0,
132   },
133   "created_on",
134   {
135     data_type => "datetime",
136     datetime_undef_if_invalid => 1,
137     is_nullable => 0,
138   },
139   "allow_change_from_owner",
140   { data_type => "tinyint", default_value => 1, is_nullable => 1 },
141   "allow_change_from_others",
142   { data_type => "tinyint", default_value => 0, is_nullable => 1 },
143   "allow_change_from_staff",
144   { data_type => "tinyint", default_value => 0, is_nullable => 1 },
145 );
146
147 =head1 PRIMARY KEY
148
149 =over 4
150
151 =item * L</shelfnumber>
152
153 =back
154
155 =cut
156
157 __PACKAGE__->set_primary_key("shelfnumber");
158
159 =head1 RELATIONS
160
161 =head2 owner
162
163 Type: belongs_to
164
165 Related object: L<Koha::Schema::Result::Borrower>
166
167 =cut
168
169 __PACKAGE__->belongs_to(
170   "owner",
171   "Koha::Schema::Result::Borrower",
172   { borrowernumber => "owner" },
173   {
174     is_deferrable => 1,
175     join_type     => "LEFT",
176     on_delete     => "SET NULL",
177     on_update     => "SET NULL",
178   },
179 );
180
181 =head2 virtualshelfcontents
182
183 Type: has_many
184
185 Related object: L<Koha::Schema::Result::Virtualshelfcontent>
186
187 =cut
188
189 __PACKAGE__->has_many(
190   "virtualshelfcontents",
191   "Koha::Schema::Result::Virtualshelfcontent",
192   { "foreign.shelfnumber" => "self.shelfnumber" },
193   { cascade_copy => 0, cascade_delete => 0 },
194 );
195
196 =head2 virtualshelfshares
197
198 Type: has_many
199
200 Related object: L<Koha::Schema::Result::Virtualshelfshare>
201
202 =cut
203
204 __PACKAGE__->has_many(
205   "virtualshelfshares",
206   "Koha::Schema::Result::Virtualshelfshare",
207   { "foreign.shelfnumber" => "self.shelfnumber" },
208   { cascade_copy => 0, cascade_delete => 0 },
209 );
210
211
212 # Created by DBIx::Class::Schema::Loader v0.07049 @ 2022-04-12 10:03:27
213 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:dzF83u6fWMs2YRrG2yBD8w
214
215 sub koha_object_class {
216     'Koha::Virtualshelf';
217 }
218 sub koha_objects_class {
219     'Koha::Virtualshelves';
220 }
221
222 __PACKAGE__->add_columns(
223     '+public' => { is_boolean => 1 },
224 );
225
226 __PACKAGE__->add_columns(
227     '+allow_change_from_staff' => { is_boolean => 1 },
228 );
229
230 # You can replace this text with custom code or comments, and it will be preserved on regeneration
231 1;