21
21
22
22
/**
23
23
* Class responsibly for persistence of prices.
24
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
24
25
*/
25
26
class PricePersistence
26
27
{
@@ -47,49 +48,49 @@ class PricePersistence
47
48
private $ productIdLocator ;
48
49
49
50
/**
50
- * Metadata pool.
51
+ * Metadata pool property to get a metadata .
51
52
*
52
53
* @var MetadataPool
53
54
*/
54
55
private $ metadataPool ;
55
56
56
57
/**
57
- * Attribute code.
58
+ * Attribute code attribute to get the attribute id .
58
59
*
59
60
* @var string
60
61
*/
61
62
private $ attributeCode ;
62
63
63
64
/**
64
- * Attribute ID.
65
+ * Attribute ID property to store the attribute id .
65
66
*
66
67
* @var int
67
68
*/
68
69
private $ attributeId ;
69
70
70
71
/**
71
- * Items per operation.
72
+ * Items per operation to chunk the array in a batch .
72
73
*
73
74
* @var int
74
75
*/
75
76
private $ itemsPerOperation = 500 ;
76
77
77
78
/**
78
- * Product Action .
79
+ * Product action property to update the attributes .
79
80
*
80
81
* @var Action
81
82
*/
82
83
private $ productAction ;
83
84
84
85
/**
85
- * Product Action .
86
+ * Core Date to get the gm date .
86
87
*
87
88
* @var CoreDate
88
89
*/
89
90
private $ coreDate ;
90
91
91
92
/**
92
- * Product Action .
93
+ * Date time property to format the date .
93
94
*
94
95
* @var DateTime
95
96
*/
@@ -124,9 +125,9 @@ public function __construct(
124
125
$ this ->metadataPool = $ metadataPool ;
125
126
$ this ->productAction = $ productAction ?: ObjectManager::getInstance ()
126
127
->get (Action::class);
127
- $ this ->coreDate = $ productAction ?: ObjectManager::getInstance ()
128
+ $ this ->coreDate = $ coreDate ?: ObjectManager::getInstance ()
128
129
->get (CoreDate::class);
129
- $ this ->dateTime = $ productAction ?: ObjectManager::getInstance ()
130
+ $ this ->dateTime = $ dateTime ?: ObjectManager::getInstance ()
130
131
->get (DateTime::class);
131
132
}
132
133
@@ -284,8 +285,8 @@ public function updateLastUpdatedAt(array $productIds): void
284
285
try {
285
286
$ this ->productAction ->updateAttributes (
286
287
$ productIds ,
287
- [ProductInterface::UPDATED_AT => $ this ->dateTime ->formatDate ($ this ->coreDate ->gmtDate ())]
288
- , Store::DEFAULT_STORE_ID
288
+ [ProductInterface::UPDATED_AT => $ this ->dateTime ->formatDate ($ this ->coreDate ->gmtDate ())],
289
+ Store::DEFAULT_STORE_ID
289
290
);
290
291
} catch (\Exception $ e ) {
291
292
throw new CouldNotSaveException (
0 commit comments