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 : IUmbracoEntity { /// /// Integer Id of the default ContentType /// int ContentTypeId { get; } /// /// Gets the Guid identifier of the content's version. /// Guid Version { get; } /// /// Gets the identifier of the writer. /// int WriterId { get; set; } /// /// 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; } /// /// Gets a value indicating 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); // fixme - what does this mean???? /// /// Gets the neutral value of a Property /// object GetValue(string propertyTypeAlias, bool published = false); /// /// Gets the culture value of a Property /// object GetValue(string propertyTypeAlias, int? languageId, bool published = false); /// /// Gets the segment value of a Property /// object GetValue(string propertyTypeAlias, string segment, bool published = false); /// /// Gets the culture+segment value of a Property /// object GetValue(string propertyTypeAlias, int? languageId, string segment, bool published = false); /// /// Gets the typed neutral value of a Property /// TPropertyValue GetValue(string propertyTypeAlias, bool published = false); /// /// Gets the typed culture value of a Property /// TPropertyValue GetValue(string propertyTypeAlias, int? languageId, bool published = false); /// /// Gets the typed segment value of a Property /// TPropertyValue GetValue(string propertyTypeAlias, string segment, bool published = false); /// /// Gets the typed culture+segment value of a Property /// TPropertyValue GetValue(string propertyTypeAlias, int? languageId, string segment, bool published = false); /// /// Sets the neutral (edited) value of a Property /// void SetValue(string propertyTypeAlias, object value); /// /// Sets the culture (edited) value of a Property /// void SetValue(string propertyTypeAlias, int? languageId, object value); /// /// Sets the segment (edited) value of a Property /// void SetValue(string propertyTypeAlias, string segment, object value); /// /// Sets the culture+segment (edited) value of a Property /// void SetValue(string propertyTypeAlias, int? languageId, string segment, object value); /// /// Gets a value indicating whether the content and its neutral properties values are valid. /// bool Validate(); /// /// Gets a value indicating whether the content and its culture properties values are valid. /// bool Validate(int? languageId); /// /// Gets a value indicating whether the content and its segment properties values are valid. /// bool Validate(string segment); /// /// Gets a value indicating whether the content and its culture+segment properties values are valid. /// bool Validate(int? languageId, string segment); /// /// Gets a value indicating whether the content and all its properties values are valid. /// bool ValidateAll(); } }