* @copyright Since 2007 PrestaShop SA and Contributors * @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) */ declare(strict_types=1); namespace PrestaShop\PrestaShop\Adapter\Product\Image\QueryHandler; use PrestaShop\PrestaShop\Adapter\Product\Image\Repository\ProductImageRepository; use PrestaShop\PrestaShop\Core\Domain\Product\Image\Query\GetShopProductImages; use PrestaShop\PrestaShop\Core\Domain\Product\Image\QueryHandler\GetShopProductImagesHandlerInterface; use PrestaShop\PrestaShop\Core\Domain\Product\Image\QueryResult\Shop\ShopProductImagesCollection; /** * Handles @see GetShopProductImages query */ final class GetShopProductImagesHandler implements GetShopProductImagesHandlerInterface { /** * @var ProductImageRepository */ private $productImageRepository; public function __construct( ProductImageRepository $productImageRepository ) { $this->productImageRepository = $productImageRepository; } /** * {@inheritDoc} */ public function handle(GetShopProductImages $query): ShopProductImagesCollection { return $this->productImageRepository->getImagesFromAllShop($query->getProductId()); } }