Class ContentTypeCompositionBase
Represents an abstract class for composition specific ContentType properties and methods
Namespace: Umbraco.Cms.Core.Models
Assembly: Umbraco.Core.dll
Syntax
[DataContract(IsReference = true)]
public abstract class ContentTypeCompositionBase : ContentTypeBase, IContentTypeComposition, IContentTypeBase, IUmbracoEntity, ITreeEntity, IEntity, IDeepCloneable, IRememberBeingDirty, ICanBeDirty
Constructors
View SourceContentTypeCompositionBase(IShortStringHelper, Int32)
Declaration
protected ContentTypeCompositionBase(IShortStringHelper shortStringHelper, int parentId)
Parameters
Type | Name | Description |
---|---|---|
IShortStringHelper | shortStringHelper | |
System.Int32 | parentId |
ContentTypeCompositionBase(IShortStringHelper, IContentTypeComposition)
Declaration
protected ContentTypeCompositionBase(IShortStringHelper shortStringHelper, IContentTypeComposition parent)
Parameters
Type | Name | Description |
---|---|---|
IShortStringHelper | shortStringHelper | |
IContentTypeComposition | parent |
ContentTypeCompositionBase(IShortStringHelper, IContentTypeComposition, String)
Declaration
protected ContentTypeCompositionBase(IShortStringHelper shortStringHelper, IContentTypeComposition parent, string alias)
Parameters
Type | Name | Description |
---|---|---|
IShortStringHelper | shortStringHelper | |
IContentTypeComposition | parent | |
System.String | alias |
Properties
View SourceCompositionPropertyGroups
Gets the property groups for the entire composition.
Declaration
[IgnoreDataMember]
public IEnumerable<PropertyGroup> CompositionPropertyGroups { get; }
Property Value
Type | Description |
---|---|
IEnumerable<PropertyGroup> |
CompositionPropertyTypes
Gets the property types for the entire composition.
Declaration
[IgnoreDataMember]
public IEnumerable<IPropertyType> CompositionPropertyTypes { get; }
Property Value
Type | Description |
---|---|
IEnumerable<IPropertyType> |
ContentTypeComposition
Gets or sets the content types that compose this content type.
Declaration
[DataMember]
public IEnumerable<IContentTypeComposition> ContentTypeComposition { get; set; }
Property Value
Type | Description |
---|---|
IEnumerable<IContentTypeComposition> |
RemovedContentTypes
Declaration
public IEnumerable<int> RemovedContentTypes { get; }
Property Value
Type | Description |
---|---|
IEnumerable<System.Int32> |
Methods
View SourceAddContentType(IContentTypeComposition)
Adds a content type to the composition.
Declaration
public bool AddContentType(IContentTypeComposition contentType)
Parameters
Type | Name | Description |
---|---|---|
IContentTypeComposition | contentType | The content type to add. |
Returns
Type | Description |
---|---|
System.Boolean | True if the content type was added, otherwise false. |
AddPropertyGroup(String, String)
Adds a property group with the specified name
and alias
.
Declaration
public override bool AddPropertyGroup(string alias, string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | alias | The alias. |
System.String | name | Name of the group. |
Returns
Type | Description |
---|---|
System.Boolean | Returns |
Remarks
This method will also check if a group already exists with the same alias.
AddPropertyType(IPropertyType, String, String)
Adds the property type to the specified property group (creates a new group if not found and a name is specified).
Declaration
public override bool AddPropertyType(IPropertyType propertyType, string propertyGroupAlias, string propertyGroupName = null)
Parameters
Type | Name | Description |
---|---|---|
IPropertyType | propertyType | The property type to add. |
System.String | propertyGroupAlias | The alias of the property group to add the property type to. |
System.String | propertyGroupName | The name of the property group to create when not found. |
Returns
Type | Description |
---|---|
System.Boolean | Returns |
CompositionAliases()
Gets a list of ContentType aliases from the current composition
Declaration
public IEnumerable<string> CompositionAliases()
Returns
Type | Description |
---|---|
IEnumerable<System.String> | An enumerable list of string aliases |
Remarks
Does not contain the alias of the Current ContentType
CompositionIds()
Gets a list of ContentType Ids from the current composition
Declaration
public IEnumerable<int> CompositionIds()
Returns
Type | Description |
---|---|
IEnumerable<System.Int32> | An enumerable list of integer ids |
Remarks
Does not contain the Id of the Current ContentType
ContentTypeCompositionExists(String)
Checks if a ContentType with the supplied alias exists in the list of composite ContentTypes
Declaration
public bool ContentTypeCompositionExists(string alias)
Parameters
Type | Name | Description |
---|---|---|
System.String | alias | Alias of a ContentType |
Returns
Type | Description |
---|---|
System.Boolean | True if ContentType with alias exists, otherwise returns False |
GetOriginalComposedPropertyTypes()
Gets the property types obtained via composition.
Declaration
public IEnumerable<IPropertyType> GetOriginalComposedPropertyTypes()
Returns
Type | Description |
---|---|
IEnumerable<IPropertyType> |
Remarks
Gets them raw, ie with their original variation.
PerformDeepClone(Object)
Declaration
protected override void PerformDeepClone(object clone)
Parameters
Type | Name | Description |
---|---|---|
System.Object | clone |
PropertyTypeExists(String)
Checks whether a PropertyType with a given alias already exists
Declaration
public override bool PropertyTypeExists(string alias)
Parameters
Type | Name | Description |
---|---|---|
System.String | alias | Alias of the PropertyType |
Returns
Type | Description |
---|---|
System.Boolean | Returns |
RemoveContentType(String)
Removes a content type with a specified alias from the composition.
Declaration
public bool RemoveContentType(string alias)
Parameters
Type | Name | Description |
---|---|---|
System.String | alias | The alias of the content type to remove. |
Returns
Type | Description |
---|---|
System.Boolean | True if the content type was removed, otherwise false. |