Webiant Logo Webiant Logo
  1. No results found.

    Try your search with a different keyword or use * as a wildcard.

ITopicService.cs

using Nop.Core.Domain.Topics;

namespace Nop.Services.Topics;

/// <summary>
/// Topic service interface
/// </summary>
public partial interface ITopicService
{
    /// <summary>
    /// Deletes a topic
    /// </summary>
    /// <param name="topic">Topic</param>
    /// <returns>A task that represents the asynchronous operation</returns>
    Task DeleteTopicAsync(Topic topic);

    /// <summary>
    /// Gets a topic
    /// </summary>
    /// <param name="topicId">The topic identifier</param>
    /// <returns>
    /// A task that represents the asynchronous operation
    /// The task result contains the topic
    /// </returns>
    Task<Topic> GetTopicByIdAsync(int topicId);

    /// <summary>
    /// Gets a topic
    /// </summary>
    /// <param name="systemName">The topic system name</param>
    /// <param name="storeId">Store identifier; pass 0 to ignore filtering by store and load the first one</param>
    /// <returns>
    /// A task that represents the asynchronous operation
    /// The task result contains the topic
    /// </returns>
    Task<Topic> GetTopicBySystemNameAsync(string systemName, int storeId = 0);

    /// <summary>
    /// Gets all topics
    /// </summary>
    /// <param name="storeId">Store identifier; pass 0 to load all records</param>
    /// <param name="ignoreAcl">A value indicating whether to ignore ACL rules</param>
    /// <param name="showHidden">A value indicating whether to show hidden topics</param>
    /// <returns>
    /// A task that represents the asynchronous operation
    /// The task result contains the topics
    /// </returns>
    Task<IList<Topic>> GetAllTopicsAsync(int storeId, bool ignoreAcl = false, bool showHidden = false);

    /// <summary>
    /// Gets all topics
    /// </summary>
    /// <param name="storeId">Store identifier; pass 0 to load all records</param>
    /// <param name="keywords">Keywords to search into body or title</param>
    /// <param name="ignoreAcl">A value indicating whether to ignore ACL rules</param>
    /// <param name="showHidden">A value indicating whether to show hidden topics</param>
    /// <returns>
    /// A task that represents the asynchronous operation
    /// The task result contains the topics
    /// </returns>
    Task<IList<Topic>> GetAllTopicsAsync(int storeId, string keywords, bool ignoreAcl = false, bool showHidden = false);

    /// <summary>
    /// Inserts a topic
    /// </summary>
    /// <param name="topic">Topic</param>
    /// <returns>A task that represents the asynchronous operation</returns>
    Task InsertTopicAsync(Topic topic);

    /// <summary>
    /// Get a value indicating whether a topic is available (availability dates)
    /// </summary>
    /// <param name="topic">Topic</param>
    /// <param name="dateTime">Datetime to check; pass null to use current date</param>
    /// <returns>Result</returns>
    bool TopicIsAvailable(Topic topic, DateTime? dateTime = null);

    /// <summary>
    /// Updates the topic
    /// </summary>
    /// <param name="topic">Topic</param>
    /// <returns>A task that represents the asynchronous operation</returns>
    Task UpdateTopicAsync(Topic topic);
}