Class ContentTypeCompositionBase
Represents an abstract class for composition specific ContentType properties and methods
Namespace: Umbraco.Core.Models
Assembly: Umbraco.Core.dll
Syntax
[Serializable]
[DataContract(IsReference = true)]
public abstract class ContentTypeCompositionBase : ContentTypeBase, IContentTypeComposition, IContentTypeBase, IUmbracoEntity, ITreeEntity, IEntity, IDeepCloneable, IRememberBeingDirty, ICanBeDirty
Constructors
View SourceContentTypeCompositionBase(Int32)
Declaration
protected ContentTypeCompositionBase(int parentId)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | parentId |
ContentTypeCompositionBase(IContentTypeComposition)
Declaration
protected ContentTypeCompositionBase(IContentTypeComposition parent)
Parameters
Type | Name | Description |
---|---|---|
IContentTypeComposition | parent |
ContentTypeCompositionBase(IContentTypeComposition, String)
Declaration
protected ContentTypeCompositionBase(IContentTypeComposition parent, string alias)
Parameters
Type | Name | Description |
---|---|---|
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 |
---|---|
System.Collections.Generic.IEnumerable<PropertyGroup> |
CompositionPropertyTypes
Gets the property types for the entire composition.
Declaration
[IgnoreDataMember]
public IEnumerable<PropertyType> CompositionPropertyTypes { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<PropertyType> |
ContentTypeComposition
Gets or sets the content types that compose this content type.
Declaration
[DataMember]
public IEnumerable<IContentTypeComposition> ContentTypeComposition { get; set; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<IContentTypeComposition> |
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)
Adds a property group with the alias based on the specified groupName
.
Declaration
[Obsolete("Use AddPropertyGroup(alias, name) instead to explicitly set the alias (note the slighty different parameter order).")]
public override bool AddPropertyGroup(string groupName)
Parameters
Type | Name | Description |
---|---|---|
System.String | groupName | 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.
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(PropertyType, String)
Adds the property type to the specified property group (creates a new group if not found).
Declaration
[Obsolete("Use AddPropertyType(propertyType, groupAlias, groupName) instead to explicitly set the alias of the group (note the slighty different parameter order).")]
public override bool AddPropertyType(PropertyType propertyType, string propertyGroupName)
Parameters
Type | Name | Description |
---|---|---|
PropertyType | propertyType | The property type to add. |
System.String | propertyGroupName | The name of the property group to add the property type to. |
Returns
Type | Description |
---|---|
System.Boolean | Returns |
AddPropertyType(PropertyType, 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(PropertyType propertyType, string groupAlias, string groupName)
Parameters
Type | Name | Description |
---|---|---|
PropertyType | propertyType | The property type to add. |
System.String | groupAlias | The alias of the property group to add the property type to. |
System.String | groupName | 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 |
---|---|
System.Collections.Generic.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 |
---|---|
System.Collections.Generic.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 |
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 propertyTypeAlias)
Parameters
Type | Name | Description |
---|---|---|
System.String | propertyTypeAlias | 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. |