using System; using System.Collections.Generic; using Umbraco.Core.Models.EntityBase; namespace Umbraco.Core.Models { /// /// Defines the base for a Content object with properties that /// are shared between Content and Media. /// public interface IContentBase : IAggregateRoot { /// /// Gets or Sets the Id of the Parent for the Content /// int ParentId { get; set; } /// /// Gets or Sets the Name of the Content /// string Name { get; set; } /// /// Gets or Sets the Sort Order of the Content /// int SortOrder { get; set; } /// /// Gets or Sets the Level of the Content /// int Level { get; set; } /// /// Gets or Sets the Path of the Content /// string Path { get; set; } /// /// Id of the user who created the Content /// int CreatorId { get; set; } /// /// Boolean indicating whether this Content is Trashed or not. /// If Content is Trashed it will be located in the Recyclebin. /// bool Trashed { get; } /// /// Integer Id of the default ContentType /// int ContentTypeId { get; } /// /// Gets the Guid Id of the Content's Version /// Guid Version { 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 PropertyCollection Properties { get; set; } /// /// List of PropertyGroups available on this Content object /// /// PropertyGroups are kind of lazy loaded as part of the object graph IEnumerable PropertyGroups { get; } /// /// List of PropertyTypes available on this Content object /// /// PropertyTypes are kind of lazy loaded as part of the object graph IEnumerable PropertyTypes { get; } /// /// Indicates whether the content object has a property with the supplied alias /// /// Alias of the PropertyType /// True if Property with given alias exists, otherwise False bool HasProperty(string propertyTypeAlias); /// /// Gets the value of a Property /// /// Alias of the PropertyType /// Value as an object GetValue(string propertyTypeAlias); /// /// Gets the value of a Property /// /// Type of the value to return /// Alias of the PropertyType /// Value as a TPassType GetValue(string propertyTypeAlias); /// /// Sets the value of a Property /// /// Alias of the PropertyType /// Value to set for the Property void SetValue(string propertyTypeAlias, object value); /// /// Boolean indicating whether the content and its properties are valid /// /// True if content is valid otherwise false bool IsValid(); } }