This class represents a draft of a content type.
Constants¶
STATUS_DEFINED ¶
|
|
Status constant for defined (aka "published") Type
STATUS_DRAFT ¶
|
|
Status constant for draft (aka "temporary") Type
STATUS_MODIFIED ¶
|
|
Status constant for modified (aka "deferred for publishing") Type
Properties¶
$contentTypeGroups¶
|
|
calls getContentTypeGroups
$creationDate¶
|
|
the date of the creation of this content type
$creatorId¶
|
|
the user id of the creator of this content type
$defaultAlwaysAvailable¶
|
|
if an instance of a content type is created the always available flag is set by default this this value.
$defaultSortField¶
|
|
Specifies which property the child locations should be sorted on by default when created. Valid values are found at
$defaultSortOrder¶
|
|
Specifies whether the sort order should be ascending or descending by default when created. Valid values are
$fieldDefinitions¶
|
|
calls getFieldDefinitions() or on access getFieldDefinition($fieldDefIdentifier)
$id¶
|
|
the id of the content type
$identifier¶
|
|
@deprecated 4.6.7 accessing magic getter is deprecated and will be removed in 5.0.0. Use ContentType::getIdentifier() instead.
$isContainer¶
|
|
@deprecated use strict getter ContentType::isContainer instead.
$languageCodes¶
|
|
array of language codes used by content type translations.
$mainLanguageCode¶
|
|
the main language of the content type names and description used for fallback.
$modificationDate¶
|
|
the date of the last modification of this content type
$modifierId¶
|
|
the user id of the user which has last modified this content type
$nameSchema¶
|
|
The name schema.
$remoteId¶
|
|
a global unique id of the content object
$status¶
|
|
the status of the content type. One of ContentType::STATUS_DEFINED|ContentType::STATUS_DRAFT|ContentType::STATUS_MODIFIED
$urlAliasSchema¶
|
|
URL alias schema. If nothing is provided, $nameSchema will be used instead.
$creationDate¶
Creation date of the content type.
|
|
$creatorId¶
Creator user id of the content type.
|
|
$defaultAlwaysAvailable¶
If an instance of a content type is created the always available flag is set by default to this value.
|
|
$defaultSortField¶
Specifies which property the child locations should be sorted on by default when created.
|
|
$defaultSortOrder¶
Specifies whether the sort order should be ascending or descending by default when created.
|
|
$id¶
Content type ID.
|
|
$identifier¶
String identifier of a content type.
|
|
$isContainer¶
A flag used to hint if content of this type may have children or not. It is highly recommended to respect this flag and not create/move content below non-containers.
|
|
But this flag is not considered as part of the content model and the API will not in any way enforce this flag to be respected.
$languageCodes¶
List of language codes used by translations.
|
|
$modificationDate¶
Modification date of the content type.
|
|
$modifierId¶
Modifier user id of the content type.
|
|
$nameSchema¶
Name schema.
|
|
Can be composed of FieldDefinition identifier place holders. These place holders must comply this pattern : <field_definition_identifier>. An OR condition can be used : <field_def|other_field_def> In this example, field_def will be used if available. If not, other_field_def will be used for content name generation
$remoteId¶
Unique remote ID of the content type.
|
|
$status¶
The status of the content type.
|
|
One of Type::STATUS_DEFINED|Type::STATUS_DRAFT|Type::STATUS_MODIFIED
$urlAliasSchema¶
URL alias schema.
|
|
If nothing is provided, $nameSchema will be used instead.
Methods¶
__construct() ¶
Construct object optionally with a set of properties.
|
|
Readonly properties values must be set using $properties as they are not writable anymore after object has been created.
Parameters
Name | Type | Default value | Description |
---|---|---|---|
$properties | array<string|int, mixed> | [] | - |
getContentTypeGroups() ¶
This method returns the content type groups this content type is assigned to.
|
|
Return values
array<string|int, ContentTypeGroup>
getFieldDefinition() ¶
This method returns the field definition for the given identifier.
|
|
Parameters
Name | Type | Default value | Description |
---|---|---|---|
$fieldDefinitionIdentifier | string | - | - |
Return values
FieldDefinition|null
getFieldDefinitions() ¶
This method returns the content type field definitions from this type.
|
|
Return values
getFieldDefinitionsOfType() ¶
Returns collection of the field definition for the given field type identifier.
|
|
Parameters
Name | Type | Default value | Description |
---|---|---|---|
$fieldTypeIdentifier | string | - | - |
Return values
getFirstFieldDefinitionOfType() ¶
Returns true if field definition with given field type identifier or null.
|
|
Parameters
Name | Type | Default value | Description |
---|---|---|---|
$fieldTypeIdentifier | string | - | - |
Return values
FieldDefinition|null
getIdentifier() ¶
|
|
Return values
string
hasFieldDefinition() ¶
This method returns true if the field definition for the given identifier exists.
|
|
Parameters
Name | Type | Default value | Description |
---|---|---|---|
$fieldDefinitionIdentifier | string | - | - |
Return values
bool
hasFieldDefinitionOfType() ¶
Returns true if field definition with given field type identifier exists.
|
|
Parameters
Name | Type | Default value | Description |
---|---|---|---|
$fieldTypeIdentifier | string | - | - |
Return values
bool
isContainer() ¶
|
|
Return values
bool
getProperties() ¶
Function where list of properties are returned.
|
|
Used by attributes(), override to add dynamic properties
Parameters
Name | Type | Default value | Description |
---|---|---|---|
$dynamicProperties | array<string|int, mixed> | [] |
Additional dynamic properties exposed on the object |
Return values
array<string|int, mixed>