Search Results for

    Show / Hide Table of Contents
    View Source

    Interface IPublishableContentRepository<TContent>

    Defines the base implementation of a repository for publishable content items.

    Namespace: Umbraco.Cms.Core.Persistence.Repositories
    Assembly: Umbraco.Core.dll
    Syntax
    public interface IPublishableContentRepository<TContent> : IContentRepository<int, TContent>, IReadWriteQueryRepository<int, TContent>, IReadRepository<int, TContent>, IWriteRepository<TContent>, IQueryRepository<TContent>, IReadRepository<Guid, TContent>, IRepository where TContent : IPublishableContentBase
    Type Parameters
    Name Description
    TContent

    Methods

    View Source

    ClearSchedule(DateTime)

    Clears the publishing schedule for all entries having a date before (lower than, or equal to) a specified date.

    Declaration
    void ClearSchedule(DateTime date)
    Parameters
    Type Name Description
    DateTime date

    The cutoff date.

    View Source

    ClearSchedule(DateTime, ContentScheduleAction)

    Clears the publishing schedule for entries matching the specified action and having a date before the specified date.

    Declaration
    void ClearSchedule(DateTime date, ContentScheduleAction action)
    Parameters
    Type Name Description
    DateTime date

    The cutoff date.

    ContentScheduleAction action

    The schedule action to clear.

    View Source

    CountPublished(string?)

    Get the count of published items

    Declaration
    int CountPublished(string? contentTypeAlias = null)
    Parameters
    Type Name Description
    string contentTypeAlias
    Returns
    Type Description
    int
    Remarks

    We require this on the repo because the IQuery{IContent} cannot supply the 'newest' parameter

    View Source

    GetContentForExpiration(DateTime)

    Gets TContent objects having an expiration date before (lower than, or equal to) a specified date.

    Declaration
    IEnumerable<TContent> GetContentForExpiration(DateTime date)
    Parameters
    Type Name Description
    DateTime date
    Returns
    Type Description
    IEnumerable<TContent>
    Remarks

    The content returned from this method may be culture variant, in which case you can use Umbraco.Extensions.ContentExtensions.GetStatus(IContent, ContentScheduleCollection, string?) to get the status for a specific culture.

    View Source

    GetContentForRelease(DateTime)

    Gets IContent objects having a release date before (lower than, or equal to) a specified date.

    Declaration
    IEnumerable<TContent> GetContentForRelease(DateTime date)
    Parameters
    Type Name Description
    DateTime date
    Returns
    Type Description
    IEnumerable<TContent>
    Remarks

    The content returned from this method may be culture variant, in which case you can use Umbraco.Extensions.ContentExtensions.GetStatus(IContent, ContentScheduleCollection, string?) to get the status for a specific culture.

    View Source

    GetContentSchedule(int)

    Gets publish/unpublish schedule for a content node.

    Declaration
    ContentScheduleCollection GetContentSchedule(int contentId)
    Parameters
    Type Name Description
    int contentId
    Returns
    Type Description
    ContentScheduleCollection

    ContentScheduleCollection

    View Source

    GetContentSchedulesByIds(int[])

    Gets the content keys from the provided collection of keys that are scheduled for publishing.

    Declaration
    IDictionary<int, IEnumerable<ContentSchedule>> GetContentSchedulesByIds(int[] contentIds)
    Parameters
    Type Name Description
    int[] contentIds

    The IDs of the content items.

    Returns
    Type Description
    IDictionary<int, IEnumerable<ContentSchedule>>

    The provided collection of content keys filtered for those that are scheduled for publishing.

    View Source

    HasContentForExpiration(DateTime)

    Checks whether there is content scheduled for expiration before the specified date.

    Declaration
    bool HasContentForExpiration(DateTime date)
    Parameters
    Type Name Description
    DateTime date

    The date to check.

    Returns
    Type Description
    bool

    true if there is content scheduled for expiration; otherwise, false.

    View Source

    HasContentForRelease(DateTime)

    Checks whether there is content scheduled for release before the specified date.

    Declaration
    bool HasContentForRelease(DateTime date)
    Parameters
    Type Name Description
    DateTime date

    The date to check.

    Returns
    Type Description
    bool

    true if there is content scheduled for release; otherwise, false.

    View Source

    IsPathPublished(TContent?)

    Checks whether the path to a content item is published.

    Declaration
    bool IsPathPublished(TContent? content)
    Parameters
    Type Name Description
    TContent content

    The content item.

    Returns
    Type Description
    bool

    true if the path is published; otherwise, false.

    View Source

    PersistContentSchedule(IPublishableContentBase, ContentScheduleCollection)

    Persists publish/unpublish schedule for a content node.

    Declaration
    void PersistContentSchedule(IPublishableContentBase content, ContentScheduleCollection schedule)
    Parameters
    Type Name Description
    IPublishableContentBase content
    ContentScheduleCollection schedule
    • View Source
    In this article
    Back to top Copyright © 2016-present Umbraco
    Generated by DocFX