Schema/Result/CartProduct.pm

filter: Statementstmt 100% 16 / 16 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 2 / 2 Podpod n/a totaltotal 100% 18 / 18 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« Schema/Result/Cart.pm ↑ Summary Schema/Result/Country.pm »
1 2 ▶use utf8;
Subroutine BEGIN: called CC=1 SCAR=0.0
2  
3 package Interchange6::Schema::Result::CartProduct;
4  
5 =head1 NAME
6  
7 Interchange6::Schema::Result::CartProduct
8  
9 =cut
10  
11 2 use Interchange6::Schema::Candy -components =>
12 2 ▶ [qw(InflateColumn::DateTime TimeStamp)];
Subroutine BEGIN: called CC=1 SCAR=0.0
13  
14 =head1 DESCRIPTION
15  
16 Holds products for related L<Interchange6::Schema::Result::Cart> class and
17 links to the full product details held in L<Interchange6::Schema::Result::Product>.
18  
19 =head1 ACCESSORS
20  
21 =head2 cart_products_id
22  
23 Primary key.
24  
25 =cut
26  
27 2 primary_column cart_products_id => {
28 data_type => "integer",
29 is_auto_increment => 1,
30 sequence => "cart_product_cart_products_id_seq",
31 };
32  
33 =head2 carts_id
34  
35 Foreign key constraint on L<Interchange6::Schema::Result::Cart/carts_id>
36 via L</cart> relationship.
37  
38 =cut
39  
40 2 column carts_id => {
41 data_type => "integer",
42 is_foreign_key => 1,
43 };
44  
45 =head2 sku
46  
47 Foreign key constraint on L<Interchange6::Schema::Result::Product/sku>
48 via L</product> relationship.
49  
50 =cut
51  
52 2 column sku => {
53 data_type => "varchar",
54 is_foreign_key => 1,
55 size => 64,
56 };
57  
58 =head2 cart_position
59  
60 Integer cart position.
61  
62 =cut
63  
64 2 column cart_position => {
65 data_type => "integer",
66 };
67  
68 =head2 quantity
69  
70 The integer quantity of product in the cart. Defaults to 1.
71  
72 =cut
73  
74 2 column quantity => {
75 data_type => "integer",
76 default_value => 1,
77 };
78  
79 =head2 created
80  
81 Date and time when this record was created returned as L<DateTime> object.
82 Value is auto-set on insert.
83  
84 =cut
85  
86 2 column created => {
87 data_type => "datetime",
88 set_on_create => 1,
89 };
90  
91 =head2 last_modified
92  
93 Date and time when this record was last modified returned as L<DateTime> object.
94 Value is auto-set on insert and update
95  
96 =cut
97  
98 2 column last_modified => {
99 data_type => "datetime",
100 set_on_create => 1,
101 set_on_update => 1,
102 };
103  
104 =head1 RELATIONS
105  
106 =head2 cart
107  
108 Type: belongs_to
109  
110 Related object: L<Interchange6::Schema::Result::Cart>
111  
112 =cut
113  
114 2 belongs_to
115 cart => "Interchange6::Schema::Result::Cart",
116 { carts_id => "carts_id" },
117 { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" };
118  
119 =head2 product
120  
121 Type: belongs_to
122  
123 Related object: L<Interchange6::Schema::Result::Product>
124  
125 =cut
126  
127 2 belongs_to
128 product => "Interchange6::Schema::Result::Product",
129 { sku => "sku" },
130 { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" };
131  
132 2 1;
« Schema/Result/Cart.pm ↑ Summary Schema/Result/Country.pm »