4574cd755278f0d962652e4ab2c0a4d432b199cf
[koha-equinox.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 =head2 shelfname
33
34   data_type: 'varchar'
35   is_nullable: 1
36   size: 255
37
38 =head2 owner
39
40   data_type: 'integer'
41   is_foreign_key: 1
42   is_nullable: 1
43
44 =head2 category
45
46   data_type: 'varchar'
47   is_nullable: 1
48   size: 1
49
50 =head2 sortfield
51
52   data_type: 'varchar'
53   default_value: 'title'
54   is_nullable: 1
55   size: 16
56
57 =head2 lastmodified
58
59   data_type: 'timestamp'
60   datetime_undef_if_invalid: 1
61   default_value: current_timestamp
62   is_nullable: 0
63
64 =head2 created_on
65
66   data_type: 'datetime'
67   datetime_undef_if_invalid: 1
68   is_nullable: 0
69
70 =head2 allow_change_from_owner
71
72   data_type: 'tinyint'
73   default_value: 1
74   is_nullable: 1
75
76 =head2 allow_change_from_others
77
78   data_type: 'tinyint'
79   default_value: 0
80   is_nullable: 1
81
82 =cut
83
84 __PACKAGE__->add_columns(
85   "shelfnumber",
86   { data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
87   "shelfname",
88   { data_type => "varchar", is_nullable => 1, size => 255 },
89   "owner",
90   { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
91   "category",
92   { data_type => "varchar", is_nullable => 1, size => 1 },
93   "sortfield",
94   {
95     data_type => "varchar",
96     default_value => "title",
97     is_nullable => 1,
98     size => 16,
99   },
100   "lastmodified",
101   {
102     data_type => "timestamp",
103     datetime_undef_if_invalid => 1,
104     default_value => \"current_timestamp",
105     is_nullable => 0,
106   },
107   "created_on",
108   {
109     data_type => "datetime",
110     datetime_undef_if_invalid => 1,
111     is_nullable => 0,
112   },
113   "allow_change_from_owner",
114   { data_type => "tinyint", default_value => 1, is_nullable => 1 },
115   "allow_change_from_others",
116   { data_type => "tinyint", default_value => 0, is_nullable => 1 },
117 );
118
119 =head1 PRIMARY KEY
120
121 =over 4
122
123 =item * L</shelfnumber>
124
125 =back
126
127 =cut
128
129 __PACKAGE__->set_primary_key("shelfnumber");
130
131 =head1 RELATIONS
132
133 =head2 owner
134
135 Type: belongs_to
136
137 Related object: L<Koha::Schema::Result::Borrower>
138
139 =cut
140
141 __PACKAGE__->belongs_to(
142   "owner",
143   "Koha::Schema::Result::Borrower",
144   { borrowernumber => "owner" },
145   {
146     is_deferrable => 1,
147     join_type     => "LEFT",
148     on_delete     => "SET NULL",
149     on_update     => "SET NULL",
150   },
151 );
152
153 =head2 virtualshelfcontents
154
155 Type: has_many
156
157 Related object: L<Koha::Schema::Result::Virtualshelfcontent>
158
159 =cut
160
161 __PACKAGE__->has_many(
162   "virtualshelfcontents",
163   "Koha::Schema::Result::Virtualshelfcontent",
164   { "foreign.shelfnumber" => "self.shelfnumber" },
165   { cascade_copy => 0, cascade_delete => 0 },
166 );
167
168 =head2 virtualshelfshares
169
170 Type: has_many
171
172 Related object: L<Koha::Schema::Result::Virtualshelfshare>
173
174 =cut
175
176 __PACKAGE__->has_many(
177   "virtualshelfshares",
178   "Koha::Schema::Result::Virtualshelfshare",
179   { "foreign.shelfnumber" => "self.shelfnumber" },
180   { cascade_copy => 0, cascade_delete => 0 },
181 );
182
183
184 # Created by DBIx::Class::Schema::Loader v0.07042 @ 2017-03-08 14:19:17
185 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Xoq0lhLouCbkAp6F4ZyMGQ
186
187
188 # You can replace this text with custom content, and it will be preserved on regeneration
189 1;