SpecialPriceStorageInterface.php 2.09 KB
Newer Older
Ketan's avatar
Ketan committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
<?php
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */

namespace Magento\Catalog\Api;

/**
 * Special price storage presents efficient price API and is used to retrieve, update or delete special prices.
 * @api
 * @since 102.0.0
 */
interface SpecialPriceStorageInterface
{
    /**
     * Return product's special price. In case of at least one of skus is not found exception will be thrown.
     *
     * @param string[] $skus
     * @return \Magento\Catalog\Api\Data\SpecialPriceInterface[]
     * @throws \Magento\Framework\Exception\NoSuchEntityException
     * @since 102.0.0
     */
    public function get(array $skus);

    /**
     * Add or update product's special price.
     * If any items will have invalid price, store id, sku or dates, they will be marked as failed and excluded from
     * update list and \Magento\Catalog\Api\Data\PriceUpdateResultInterface[] with problem description will be returned.
     * If there were no failed items during update empty array will be returned.
     * If error occurred during the update exception will be thrown.
     *
     * @param \Magento\Catalog\Api\Data\SpecialPriceInterface[] $prices
     * @return \Magento\Catalog\Api\Data\PriceUpdateResultInterface[]
     * @throws \Magento\Framework\Exception\CouldNotSaveException
     * @since 102.0.0
     */
    public function update(array $prices);

    /**
     * Delete product's special price.
     * If any items will have invalid price, store id, sku or dates, they will be marked as failed and excluded from
     * delete list and \Magento\Catalog\Api\Data\PriceUpdateResultInterface[] with problem description will be returned.
     * If there were no failed items during update empty array will be returned.
     * If error occurred during the delete exception will be thrown.
     *
     * @param \Magento\Catalog\Api\Data\SpecialPriceInterface[] $prices
     * @return \Magento\Catalog\Api\Data\PriceUpdateResultInterface[]
     * @throws \Magento\Framework\Exception\CouldNotDeleteException
     * @since 102.0.0
     */
    public function delete(array $prices);
}