* @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\Core\Domain\Product\Exception; use PrestaShop\PrestaShop\Core\Domain\Product\ValueObject\ProductId; /** * Base class to use for bulk operations, it stores a list of exception indexed by the product ID that was impacted. * It should be used as a base class for all the bulk action exceptions. */ class BulkProductException extends ProductException { /** * @var array */ protected $bulkExceptions = []; public function addException(ProductId $productId, ProductException $exception): void { $this->bulkExceptions[$productId->getValue()] = $exception; } /** * @return ProductException[] */ public function getBulkExceptions(): array { return $this->bulkExceptions; } }