<?php
/**
 * @author Aitoc Team
 * @copyright Copyright (c) 2020 Aitoc (https://www.aitoc.com)
 * @package Aitoc_PreOrders
 */

/**
 * Copyright © 2018 Aitoc. All rights reserved.
 * Developed by Alex Yakimovich
 */

namespace Aitoc\PreOrders\Api;

use Aitoc\PreOrders\Api\Data\PreOrderSubscribersInterface;
use Magento\Framework\Exception\LocalizedException;
use Magento\Framework\Exception\NoSuchEntityException;
use Magento\Framework\Api\SearchCriteriaInterface;
use Aitoc\PreOrders\Api\Data\PreOrderSubscribersSearchResultsInterface;

/**
 * Pre-Order Subscribers Repository interface.
 * @api
 */
interface PreOrderSubscribersRepositoryInterface
{
    /**
     * Save entity.
     *
     * @param PreOrderSubscribersInterface $entity
     * @return PreOrderSubscribersInterface
     * @throws LocalizedException
     */
    public function save(PreOrderSubscribersInterface $entity);

    /**
     * Retrieve entity.
     *
     * @param int $entityId
     * @return PreOrderSubscribersInterface
     * @throws LocalizedException
     */
    public function get($entityId);

    /**
     * Retrieve entity list by criteria.
     *
     * @param SearchCriteriaInterface $searchCriteria
     * @return PreOrderSubscribersSearchResultsInterface
     * @throws LocalizedException
     */
    public function getList(SearchCriteriaInterface $searchCriteria);

    /**
     * Delete entity.
     *
     * @param PreOrderSubscribersInterface $entity
     * @return bool true on success
     * @throws LocalizedException
     */
    public function delete(PreOrderSubscribersInterface $entity);

    /**
     * Delete entity by ID.
     *
     * @param int $entityId
     * @return bool true on success
     * @throws NoSuchEntityException
     * @throws LocalizedException
     */
    public function deleteById($entityId);
}
