6
6
namespace Magento \Catalog \Model \Product ;
7
7
8
8
use Magento \Catalog \Model \Product ;
9
+ use Magento \Catalog \Model \Product \Type \Pool ;
10
+ use Magento \Catalog \Model \Product \Type \Price ;
11
+ use Magento \Catalog \Model \Product \Type \Price \Factory as PriceFactory ;
12
+ use Magento \Catalog \Model \Product \Type \Simple ;
13
+ use Magento \Catalog \Model \ProductTypes \ConfigInterface ;
9
14
use Magento \Framework \Data \OptionSourceInterface ;
15
+ use Magento \Framework \Pricing \PriceInfo \Factory as PriceInfoFactory ;
10
16
11
17
/**
12
18
* Product type model
13
19
*
20
+ *
14
21
* @api
15
22
* @since 100.0.2
16
23
*/
17
24
class Type implements OptionSourceInterface
18
25
{
19
- /**#@+
20
- * Available product types
21
- */
22
26
const TYPE_SIMPLE = 'simple ' ;
23
27
24
28
const TYPE_BUNDLE = 'bundle ' ;
25
29
26
30
const TYPE_VIRTUAL = 'virtual ' ;
27
- /**#@-*/
28
31
29
- /**
30
- * Default product type
31
- */
32
32
const DEFAULT_TYPE = 'simple ' ;
33
33
34
- /**
35
- * Default product type model
36
- */
37
- const DEFAULT_TYPE_MODEL = \Magento \Catalog \Model \Product \Type \Simple::class;
34
+ const DEFAULT_TYPE_MODEL = Simple::class;
38
35
39
- /**
40
- * Default price model
41
- */
42
- const DEFAULT_PRICE_MODEL = \Magento \Catalog \Model \Product \Type \Price::class;
36
+ const DEFAULT_PRICE_MODEL = Price::class;
43
37
44
38
/**
45
- * @var \Magento\Catalog\Model\ProductTypes\ ConfigInterface
39
+ * @var ConfigInterface
46
40
*/
47
41
protected $ _config ;
48
42
@@ -77,35 +71,35 @@ class Type implements OptionSourceInterface
77
71
/**
78
72
* Product type factory
79
73
*
80
- * @var \Magento\Catalog\Model\Product\Type\ Pool
74
+ * @var Pool
81
75
*/
82
76
protected $ _productTypePool ;
83
77
84
78
/**
85
79
* Price model factory
86
80
*
87
- * @var \Magento\Catalog\Model\Product\Type\Price\Factory
81
+ * @var PriceFactory
88
82
*/
89
83
protected $ _priceFactory ;
90
84
91
85
/**
92
- * @var \Magento\Framework\Pricing\PriceInfo\Factory
86
+ * @var PriceInfoFactory
93
87
*/
94
88
protected $ _priceInfoFactory ;
95
89
96
90
/**
97
91
* Construct
98
92
*
99
- * @param \Magento\Catalog\Model\ProductTypes\ ConfigInterface $config
100
- * @param \Magento\Catalog\Model\Product\Type\ Pool $productTypePool
101
- * @param \Magento\Catalog\Model\Product\Type\Price\Factory $priceFactory
102
- * @param \Magento\Framework\Pricing\PriceInfo\Factory $priceInfoFactory
93
+ * @param ConfigInterface $config
94
+ * @param Pool $productTypePool
95
+ * @param PriceFactory $priceFactory
96
+ * @param PriceInfoFactory $priceInfoFactory
103
97
*/
104
98
public function __construct (
105
- \ Magento \ Catalog \ Model \ ProductTypes \ ConfigInterface $ config ,
106
- \ Magento \ Catalog \ Model \ Product \ Type \ Pool $ productTypePool ,
107
- \ Magento \ Catalog \ Model \ Product \ Type \ Price \ Factory $ priceFactory ,
108
- \ Magento \ Framework \ Pricing \ PriceInfo \ Factory $ priceInfoFactory
99
+ ConfigInterface $ config ,
100
+ Pool $ productTypePool ,
101
+ PriceFactory $ priceFactory ,
102
+ PriceInfoFactory $ priceInfoFactory
109
103
) {
110
104
$ this ->_config = $ config ;
111
105
$ this ->_productTypePool = $ productTypePool ;
@@ -116,8 +110,8 @@ public function __construct(
116
110
/**
117
111
* Factory to product singleton product type instances
118
112
*
119
- * @param \Magento\Catalog\Model\Product $product
120
- * @return \Magento\Catalog\Model\Product\Type\AbstractType
113
+ * @param \Magento\Catalog\Api\Data\ProductInterface $product
114
+ * @return \Magento\Catalog\Model\Product\Type\AbstractType
121
115
*/
122
116
public function factory ($ product )
123
117
{
@@ -139,8 +133,8 @@ public function factory($product)
139
133
/**
140
134
* Product type price model factory
141
135
*
142
- * @param string $productType
143
- * @return \Magento\Catalog\Model\Product\Type\Price
136
+ * @param string $productType
137
+ * @return \Magento\Catalog\Model\Product\Type\Price
144
138
*/
145
139
public function priceFactory ($ productType )
146
140
{
0 commit comments