ContentType
this class represents a content type value.
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
$creationDate
¶
Creation date of the content type.
|
|
$creatorId
¶
|
|
the user id of the creator of this 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 this this value.
$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. Valid values are found at
$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. Valid values are
$defaultSortOrder
¶
Specifies whether the sort order should be ascending or descending by default when created.
|
|
$fieldDefinitions
¶
|
|
calls getFieldDefinitions() or on access getFieldDefinition($fieldDefIdentifier)
$id
¶
|
|
the id of the content type
$id
¶
Content type ID.
|
|
$identifier
¶
|
|
@deprecated 4.6.7 accessing magic getter is deprecated and will be removed in 5.0.0. Use ContentType::getIdentifier() instead.
$identifier
¶
String identifier of a content type.
|
|
$isContainer
¶
|
|
@deprecated use strict getter ContentType::isContainer instead.
$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
¶
|
|
array of language codes used by content type translations.
$languageCodes
¶
List of language codes used by 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
$modificationDate
¶
Modification date of the content type.
|
|
$modifierId
¶
|
|
the user id of the user which has last modified this content type
$modifierId
¶
Modifier user id of the content type.
|
|
$nameSchema
¶
|
|
The name schema.
$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
¶
|
|
a global unique id of the content object
$remoteId
¶
Unique remote ID of the content type.
|
|
$status
¶
|
|
the status of the content type. One of ContentType::STATUS_DEFINED|ContentType::STATUS_DRAFT|ContentType::STATUS_MODIFIED
$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.
$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 aren't writable anymore
after object has been created.
Parameters
Name | Type | Default value | Description |
---|---|---|---|
$properties | array<string, 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()
¶
Returns list of available properties' names.
|
|
Override to add dynamic properties.
Parameters
Name | Type | Default value | Description |
---|---|---|---|
$dynamicProperties | array<int, string> | [] |
Additional dynamic properties exposed on the object |
Return values
array<int, string>