Copied!

ContentType

ContentType.php : 37
Abstract
Extends ValueObject

this class represents a content type value.

Constants

publicSTATUS_DEFINED

ContentType.php : 40
public int STATUS_DEFINED = 0

Status constant for defined (aka "published") Type

publicSTATUS_DRAFT

ContentType.php : 43
public int STATUS_DRAFT = 1

Status constant for draft (aka "temporary") Type

publicSTATUS_MODIFIED

ContentType.php : 46
public int STATUS_MODIFIED = 2

Status constant for modified (aka "deferred for publishing") Type

Properties

public $contentTypeGroups read-only

ContentType.php
public array<string|int, ContentTypeGroup$contentTypeGroups

calls getContentTypeGroups

public $fieldDefinitions read-only

ContentType.php
public FieldDefinitionCollection $fieldDefinitions

calls getFieldDefinitions() or on access getFieldDefinition($fieldDefIdentifier)

public $mainLanguageCode read-only

ContentType.php
public string $mainLanguageCode

the main language of the content type names and description used for fallback.

protected $creationDate

ContentType.php : 74

Creation date of the content type.

protected DateTime $creationDate

protected $creatorId

ContentType.php : 88

Creator user id of the content type.

protected mixed $creatorId

protected $defaultAlwaysAvailable

ContentType.php : 140

If an instance of a content type is created the always available flag is set by default to this value.

protected bool $defaultAlwaysAvailable = true

protected $defaultSortField

ContentType.php : 149

Specifies which property the child locations should be sorted on by default when created.

protected int $defaultSortField

Valid values are found at

protected $defaultSortOrder

ContentType.php : 158

Specifies whether the sort order should be ascending or descending by default when created.

protected int $defaultSortOrder

Valid values are

protected $id

ContentType.php : 53

Content type ID.

protected mixed $id

protected $identifier

ContentType.php : 67

String identifier of a content type.

protected string $identifier

protected $isContainer

ContentType.php : 132

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.

protected bool $isContainer

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.

protected $languageCodes

ContentType.php : 165

List of language codes used by translations.

protected array<string|int, string> $languageCodes

protected $modificationDate

ContentType.php : 81

Modification date of the content type.

protected DateTime $modificationDate

protected $modifierId

ContentType.php : 95

Modifier user id of the content type.

protected mixed $modifierId

protected $nameSchema

ContentType.php : 124

Name schema.

protected string $nameSchema

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

protected $remoteId

ContentType.php : 102

Unique remote ID of the content type.

protected string $remoteId

protected $status

ContentType.php : 60

The status of the content type.

protected int $status

One of Type::STATUS_DEFINED|Type::STATUS_DRAFT|Type::STATUS_MODIFIED

protected $urlAliasSchema

ContentType.php : 111

URL alias schema.

protected string $urlAliasSchema

If nothing is provided, $nameSchema will be used instead.

Methods

public__construct()

ValueObject.php : 31

Construct object optionally with a set of properties.

public __construct([array<string, mixed> $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> [] -

publicgetContentTypeGroups()

ContentType.php : 172

This method returns the content type groups this content type is assigned to.

public abstract getContentTypeGroups() : array<string|int, ContentTypeGroup>

Return values

array<string|int, ContentTypeGroup>

publicgetFieldDefinition()

ContentType.php : 191

This method returns the field definition for the given identifier.

public getFieldDefinition(string $fieldDefinitionIdentifier) : FieldDefinition|null

Parameters

Name Type Default value Description
$fieldDefinitionIdentifier string - -

Return values

FieldDefinition|null

publicgetFieldDefinitions()

ContentType.php : 177

This method returns the content type field definitions from this type.

public abstract getFieldDefinitions() : FieldDefinitionCollection

Return values

FieldDefinitionCollection

publicgetFieldDefinitionsOfType()

ContentType.php : 219

Returns collection of the field definition for the given field type identifier.

public getFieldDefinitionsOfType(string $fieldTypeIdentifier) : FieldDefinitionCollection

Parameters

Name Type Default value Description
$fieldTypeIdentifier string - -

Return values

FieldDefinitionCollection

publicgetFirstFieldDefinitionOfType()

ContentType.php : 227

Returns true if field definition with given field type identifier or null.

public getFirstFieldDefinitionOfType(string $fieldTypeIdentifier) : FieldDefinition|null

Parameters

Name Type Default value Description
$fieldTypeIdentifier string - -

Return values

FieldDefinition|null

publicgetIdentifier()

ContentType.php : 179
public getIdentifier() : string

Return values

string

publichasFieldDefinition()

ContentType.php : 203

This method returns true if the field definition for the given identifier exists.

public hasFieldDefinition(string $fieldDefinitionIdentifier) : bool

Parameters

Name Type Default value Description
$fieldDefinitionIdentifier string - -

Return values

bool

publichasFieldDefinitionOfType()

ContentType.php : 211

Returns true if field definition with given field type identifier exists.

public hasFieldDefinitionOfType(string $fieldTypeIdentifier) : bool

Parameters

Name Type Default value Description
$fieldTypeIdentifier string - -

Return values

bool

publicisContainer()

ContentType.php : 237
public isContainer() : bool

Return values

bool

protectedgetProperties()

ValueObject.php : 54

Returns list of available properties' names.

protected getProperties([array<int, string> $dynamicProperties = [] ]) : array<int, string>

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>

Tags
Serializerignore

()