/
IsotopeProduct.php
175 lines (150 loc) · 3.73 KB
/
IsotopeProduct.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
<?php
/*
* Isotope eCommerce for Contao Open Source CMS
*
* Copyright (C) 2009 - 2019 terminal42 gmbh & Isotope eCommerce Workgroup
*
* @link https://isotopeecommerce.org
* @license https://opensource.org/licenses/lgpl-3.0.html
*/
namespace Isotope\Interfaces;
use Contao\PageModel;
use Isotope\Model\ProductType;
/**
* IsotopeProduct is the interface for a product object
*/
interface IsotopeProduct
{
/**
* Returns the ID for the product or variant.
*
* @return int
*/
public function getId();
/**
* Returns the ID for this product or the parent of a variant.
*
* @return int
*/
public function getProductId();
/**
* Return the unique form ID for the product
*
* @return string
*/
public function getFormId();
/**
* Returns the product type for this product, or null if not applicable or not found.
*
* @return ProductType|null
*/
public function getType();
/**
* Returns the product name, necessary to store as fallback in the product collection.
*
* @return string
*/
public function getName();
/**
* Returns the product SKU, necessary to store as fallback in the product collection.
*
* @return string
*/
public function getSku();
/**
* Returns true if the product is available in the frontend
*
* @return bool
*/
public function isAvailableInFrontend();
/**
* Returns true if the product is available in the given collection
*
* @param IsotopeProductCollection $objCollection
*
* @return bool
*/
public function isAvailableForCollection(IsotopeProductCollection $objCollection);
/**
* Returns true if the product is published, otherwise returns false
*
* @return bool
*/
public function isPublished();
/**
* Checks whether a product is new according to the current store config
*
* @return bool
*/
public function isNew();
/**
* Checks whether a product is exempt from shipping
*
* @return bool
*/
public function isExemptFromShipping();
/**
* Returns true if variants are enabled in the product, otherwise returns false
*
* @return bool
*/
public function hasVariants();
/**
* Returns an array of variant IDs
*
* @return array
*/
public function getVariantIds();
/**
* Returns true if this product is a variant
*
* @return bool
*/
public function isVariant();
/**
* Returns true if product has variants, and the price is a variant attribute
*
* @return bool
*/
public function hasVariantPrices();
/**
* Returns true if advanced prices are enabled in the product type, otherwise returns false
*
* @return bool
*/
public function hasAdvancedPrices();
/**
* Get product price model
*
* @param IsotopeProductCollection $objCollection
*
* @return IsotopePrice
*/
public function getPrice(IsotopeProductCollection $objCollection = null);
/**
* Return minimum quantity for the product (from advanced price tiers)
*
* @return int
*/
public function getMinimumQuantity();
/**
* See IsotopeProductWithOptions interface!
*
* @return array
*/
public function getOptions();
/**
* Generate a product template
*
* @param array $arrConfig
*
* @return string
*/
public function generate(array $arrConfig);
/**
* Returns URL with product alias to given page.
*
* @return string
*/
public function generateUrl(PageModel $objJumpTo = null/*, bool $absolute = false*/);
}