Bug 8798: DBIx::Class base classes for all Koha tables
[koha.git] / Koha / Schema / Result / Aqbasket.pm
1 package Koha::Schema::Result::Aqbasket;
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::Aqbasket
15
16 =cut
17
18 __PACKAGE__->table("aqbasket");
19
20 =head1 ACCESSORS
21
22 =head2 basketno
23
24   data_type: 'integer'
25   is_auto_increment: 1
26   is_nullable: 0
27
28 =head2 basketname
29
30   data_type: 'varchar'
31   is_nullable: 1
32   size: 50
33
34 =head2 note
35
36   data_type: 'mediumtext'
37   is_nullable: 1
38
39 =head2 booksellernote
40
41   data_type: 'mediumtext'
42   is_nullable: 1
43
44 =head2 contractnumber
45
46   data_type: 'integer'
47   is_foreign_key: 1
48   is_nullable: 1
49
50 =head2 creationdate
51
52   data_type: 'date'
53   is_nullable: 1
54
55 =head2 closedate
56
57   data_type: 'date'
58   is_nullable: 1
59
60 =head2 booksellerid
61
62   data_type: 'integer'
63   default_value: 1
64   is_foreign_key: 1
65   is_nullable: 0
66
67 =head2 authorisedby
68
69   data_type: 'varchar'
70   is_nullable: 1
71   size: 10
72
73 =head2 booksellerinvoicenumber
74
75   data_type: 'mediumtext'
76   is_nullable: 1
77
78 =head2 basketgroupid
79
80   data_type: 'integer'
81   is_foreign_key: 1
82   is_nullable: 1
83
84 =cut
85
86 __PACKAGE__->add_columns(
87   "basketno",
88   { data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
89   "basketname",
90   { data_type => "varchar", is_nullable => 1, size => 50 },
91   "note",
92   { data_type => "mediumtext", is_nullable => 1 },
93   "booksellernote",
94   { data_type => "mediumtext", is_nullable => 1 },
95   "contractnumber",
96   { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
97   "creationdate",
98   { data_type => "date", is_nullable => 1 },
99   "closedate",
100   { data_type => "date", is_nullable => 1 },
101   "booksellerid",
102   {
103     data_type      => "integer",
104     default_value  => 1,
105     is_foreign_key => 1,
106     is_nullable    => 0,
107   },
108   "authorisedby",
109   { data_type => "varchar", is_nullable => 1, size => 10 },
110   "booksellerinvoicenumber",
111   { data_type => "mediumtext", is_nullable => 1 },
112   "basketgroupid",
113   { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
114 );
115 __PACKAGE__->set_primary_key("basketno");
116
117 =head1 RELATIONS
118
119 =head2 booksellerid
120
121 Type: belongs_to
122
123 Related object: L<Koha::Schema::Result::Aqbookseller>
124
125 =cut
126
127 __PACKAGE__->belongs_to(
128   "booksellerid",
129   "Koha::Schema::Result::Aqbookseller",
130   { id => "booksellerid" },
131   { on_delete => "CASCADE", on_update => "CASCADE" },
132 );
133
134 =head2 contractnumber
135
136 Type: belongs_to
137
138 Related object: L<Koha::Schema::Result::Aqcontract>
139
140 =cut
141
142 __PACKAGE__->belongs_to(
143   "contractnumber",
144   "Koha::Schema::Result::Aqcontract",
145   { contractnumber => "contractnumber" },
146   { join_type => "LEFT", on_delete => "CASCADE", on_update => "CASCADE" },
147 );
148
149 =head2 basketgroupid
150
151 Type: belongs_to
152
153 Related object: L<Koha::Schema::Result::Aqbasketgroup>
154
155 =cut
156
157 __PACKAGE__->belongs_to(
158   "basketgroupid",
159   "Koha::Schema::Result::Aqbasketgroup",
160   { id => "basketgroupid" },
161   { join_type => "LEFT", on_delete => "CASCADE", on_update => "CASCADE" },
162 );
163
164 =head2 aqorders
165
166 Type: has_many
167
168 Related object: L<Koha::Schema::Result::Aqorder>
169
170 =cut
171
172 __PACKAGE__->has_many(
173   "aqorders",
174   "Koha::Schema::Result::Aqorder",
175   { "foreign.basketno" => "self.basketno" },
176   { cascade_copy => 0, cascade_delete => 0 },
177 );
178
179
180 # Created by DBIx::Class::Schema::Loader v0.07000 @ 2012-09-02 08:44:15
181 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:eRG3p93qKZhp3rNPwG60Ig
182
183
184 # You can replace this text with custom content, and it will be preserved on regeneration
185 1;