Skip to content

Commit 1d71642

Browse files
Update comment on getProduct() method
1 parent c9d4f45 commit 1d71642

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Plugin/SetCachedImageUrls.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@ public function __construct(
2828
/**
2929
* Retrieve the product used to initialize the ImageHelper
3030
*
31+
* The image helper uses the product to retrieve the correct label of an image.
32+
* As the label is already correctly set at this point, this information is not necessary.
33+
* Thus, an "empty" product is used, instead of retrieving each product from the repository.
34+
* This drastically improves performance by avoiding database calls in a foreach-loop.
35+
*
3136
* @return Product
3237
*/
3338
private function getProduct(): Product

0 commit comments

Comments
 (0)