using Umbraco.Cms.Core.Models.Entities;
namespace Umbraco.Cms.Core.Models;
///
/// Provides a base class for content items.
///
///
/// Content items are documents, medias and members.
/// Content items have a content type, and properties.
///
public interface IContentBase : IUmbracoEntity, IRememberBeingDirty
{
///
/// Integer Id of the default ContentType
///
int ContentTypeId { get; }
///
/// Gets the content type of this content.
///
ISimpleContentType ContentType { get; }
///
/// Gets the identifier of the writer.
///
int WriterId { get; set; }
///
/// Gets the version identifier.
///
int VersionId { get; set; }
///
/// Gets culture infos of the content item.
///
///
///
/// Because a dictionary key cannot be null this cannot contain the invariant
/// culture name, which must be get or set via the property.
///
///
ContentCultureInfosCollection? CultureInfos { get; set; }
///
/// Gets the available cultures.
///
///
/// Cannot contain the invariant culture, which is always available.
///
IEnumerable AvailableCultures { get; }
///
/// List of properties, which make up all the data available for this Content object
///
/// Properties are loaded as part of the Content object graph
IPropertyCollection Properties { get; set; }
///
/// Sets the name of the content item for a specified culture.
///
///
///
/// When is null, sets the invariant
/// culture name, which sets the property.
///
///
/// When is not null, throws if the content
/// type does not vary by culture.
///
///
void SetCultureName(string? value, string? culture);
///
/// Gets the name of the content item for a specified language.
///
///
///
/// When is null, gets the invariant
/// culture name, which is the value of the property.
///
///
/// When is not null, and the content type
/// does not vary by culture, returns null.
///
///
string? GetCultureName(string? culture);
///
/// Gets a value indicating whether a given culture is available.
///
///
///
/// A culture becomes available whenever the content name for this culture is
/// non-null, and it becomes unavailable whenever the content name is null.
///
///
/// Returns false for the invariant culture, in order to be consistent
/// with , even though the invariant culture is
/// always available.
///
/// Does not support the '*' wildcard (returns false).
///
bool IsCultureAvailable(string culture);
///
/// Gets the date a culture was updated.
///
///
/// When is null, returns null.
/// If the specified culture is not available, returns null.
///
DateTime? GetUpdateDate(string culture);
///
/// Gets a value indicating whether the content entity has a property with the supplied alias.
///
///
/// Indicates that the content entity has a property with the supplied alias, but
/// not necessarily that the content has a value for that property. Could be missing.
///
bool HasProperty(string propertyTypeAlias);
///
/// Gets the value of a Property
///
/// Values 'null' and 'empty' are equivalent for culture and segment.
object? GetValue(string propertyTypeAlias, string? culture = null, string? segment = null, bool published = false);
///
/// Gets the typed value of a Property
///
/// Values 'null' and 'empty' are equivalent for culture and segment.
TValue? GetValue(string propertyTypeAlias, string? culture = null, string? segment = null, bool published = false);
///
/// Sets the (edited) value of a Property
///
/// Values 'null' and 'empty' are equivalent for culture and segment.
void SetValue(string propertyTypeAlias, object? value, string? culture = null, string? segment = null);
}