Bug 8798: DBIx::Class base classes for all Koha tables
[koha.git] / Koha / Schema / Result / Virtualshelve.pm
1 package Koha::Schema::Result::Virtualshelve;
2
3 # Created by DBIx::Class::Schema::Loader
4 # DO NOT MODIFY THE FIRST PART OF THIS FILE
5
6 use strict;
7 use warnings;
8
9 use base 'DBIx::Class::Core';
10
11
12 =head1 NAME
13
14 Koha::Schema::Result::Virtualshelve
15
16 =cut
17
18 __PACKAGE__->table("virtualshelves");
19
20 =head1 ACCESSORS
21
22 =head2 shelfnumber
23
24   data_type: 'integer'
25   is_auto_increment: 1
26   is_nullable: 0
27
28 =head2 shelfname
29
30   data_type: 'varchar'
31   is_nullable: 1
32   size: 255
33
34 =head2 owner
35
36   data_type: 'integer'
37   is_foreign_key: 1
38   is_nullable: 1
39
40 =head2 category
41
42   data_type: 'varchar'
43   is_nullable: 1
44   size: 1
45
46 =head2 sortfield
47
48   data_type: 'varchar'
49   is_nullable: 1
50   size: 16
51
52 =head2 lastmodified
53
54   data_type: 'timestamp'
55   default_value: current_timestamp
56   is_nullable: 0
57
58 =head2 allow_add
59
60   data_type: 'tinyint'
61   default_value: 0
62   is_nullable: 1
63
64 =head2 allow_delete_own
65
66   data_type: 'tinyint'
67   default_value: 1
68   is_nullable: 1
69
70 =head2 allow_delete_other
71
72   data_type: 'tinyint'
73   default_value: 0
74   is_nullable: 1
75
76 =cut
77
78 __PACKAGE__->add_columns(
79   "shelfnumber",
80   { data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
81   "shelfname",
82   { data_type => "varchar", is_nullable => 1, size => 255 },
83   "owner",
84   { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
85   "category",
86   { data_type => "varchar", is_nullable => 1, size => 1 },
87   "sortfield",
88   { data_type => "varchar", is_nullable => 1, size => 16 },
89   "lastmodified",
90   {
91     data_type     => "timestamp",
92     default_value => \"current_timestamp",
93     is_nullable   => 0,
94   },
95   "allow_add",
96   { data_type => "tinyint", default_value => 0, is_nullable => 1 },
97   "allow_delete_own",
98   { data_type => "tinyint", default_value => 1, is_nullable => 1 },
99   "allow_delete_other",
100   { data_type => "tinyint", default_value => 0, is_nullable => 1 },
101 );
102 __PACKAGE__->set_primary_key("shelfnumber");
103
104 =head1 RELATIONS
105
106 =head2 virtualshelfcontents
107
108 Type: has_many
109
110 Related object: L<Koha::Schema::Result::Virtualshelfcontent>
111
112 =cut
113
114 __PACKAGE__->has_many(
115   "virtualshelfcontents",
116   "Koha::Schema::Result::Virtualshelfcontent",
117   { "foreign.shelfnumber" => "self.shelfnumber" },
118   { cascade_copy => 0, cascade_delete => 0 },
119 );
120
121 =head2 virtualshelfshares
122
123 Type: has_many
124
125 Related object: L<Koha::Schema::Result::Virtualshelfshare>
126
127 =cut
128
129 __PACKAGE__->has_many(
130   "virtualshelfshares",
131   "Koha::Schema::Result::Virtualshelfshare",
132   { "foreign.shelfnumber" => "self.shelfnumber" },
133   { cascade_copy => 0, cascade_delete => 0 },
134 );
135
136 =head2 owner
137
138 Type: belongs_to
139
140 Related object: L<Koha::Schema::Result::Borrower>
141
142 =cut
143
144 __PACKAGE__->belongs_to(
145   "owner",
146   "Koha::Schema::Result::Borrower",
147   { borrowernumber => "owner" },
148   { join_type => "LEFT", on_delete => "CASCADE", on_update => "CASCADE" },
149 );
150
151
152 # Created by DBIx::Class::Schema::Loader v0.07000 @ 2012-09-02 08:44:15
153 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:GitYLGGw2F/bqc511p2oTg
154
155
156 # You can replace this text with custom content, and it will be preserved on regeneration
157 1;