<?php
/**
 * @author  Magediary
 * @package Magediary_ProductQuestion
 */

namespace Magediary\ProductQuestion\Api;

use Magediary\ProductQuestion\Api\Data\QuestionInterface;
use Magediary\ProductQuestion\Api\Data\QuestionSearchResultsInterface;
use Magento\Framework\Api\SearchCriteriaInterface;

interface QuestionRepositoryInterface
{
    /**
     * Save Question
     *
     * @param QuestionInterface $question
     * @return QuestionInterface
     * @throws \Magento\Framework\Exception\LocalizedException
     */
    public function save(
        QuestionInterface $question
    );

    /**
     * Retrieve Question
     *
     * @param string $questionId
     * @return QuestionInterface
     * @throws \Magento\Framework\Exception\LocalizedException
     */
    public function getById($questionId);

    /**
     * Retrieve Question matching the specified criteria.
     *
     * @param SearchCriteriaInterface $searchCriteria
     * @return QuestionSearchResultsInterface
     * @throws \Magento\Framework\Exception\LocalizedException
     */
    public function getList(
        SearchCriteriaInterface $searchCriteria
    );

    /**
     * Delete Question
     *
     * @param QuestionInterface $question
     * @return bool true on success
     * @throws \Magento\Framework\Exception\LocalizedException
     */
    public function delete(
        QuestionInterface $question
    );

    /**
     * Delete Question by ID
     *
     * @param string $questionId
     * @return bool true on success
     * @throws \Magento\Framework\Exception\NoSuchEntityException
     * @throws \Magento\Framework\Exception\LocalizedException
     */
    public function deleteById($questionId);
}
