Copied!

ContentType

ContentType.php : 37
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 $creationDate read-only

ContentType.php
public DateTime $creationDate

the date of the creation of this content type

public $creatorId read-only

ContentType.php
public mixed $creatorId

the user id of the creator of this content type

public $defaultAlwaysAvailable read-only

ContentType.php
public bool $defaultAlwaysAvailable

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

public $defaultSortField read-only

ContentType.php
public int $defaultSortField

Specifies which property the child locations should be sorted on by default when created. Valid values are found at

public $defaultSortOrder read-only

ContentType.php
public int $defaultSortOrder

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

public $fieldDefinitions read-only

ContentType.php
public FieldDefinitionCollection $fieldDefinitions

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

public $id read-only

ContentType.php
public mixed $id

the id of the content type

public $identifier read-only

ContentType.php
public string $identifier

@deprecated 4.6.7 accessing magic getter is deprecated and will be removed in 5.0.0. Use ContentType::getIdentifier() instead.

public $isContainer read-only

ContentType.php
public bool $isContainer

@deprecated use strict getter ContentType::isContainer instead.

public $languageCodes read-only

ContentType.php
public array<string|int, string> $languageCodes

array of language codes used by content type translations.

public $mainLanguageCode read-only

ContentType.php
public string $mainLanguageCode

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

public $modificationDate read-only

ContentType.php
public DateTime $modificationDate

the date of the last modification of this content type

public $modifierId read-only

ContentType.php
public mixed $modifierId

the user id of the user which has last modified this content type

public $nameSchema read-only

ContentType.php
public string $nameSchema

The name schema.

public $remoteId read-only

ContentType.php
public string $remoteId

a global unique id of the content object

public $status read-only

ContentType.php
public int $status

the status of the content type. One of ContentType::STATUS_DEFINED|ContentType::STATUS_DRAFT|ContentType::STATUS_MODIFIED

public $urlAliasSchema read-only

ContentType.php
public string $urlAliasSchema

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

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 : 30

Construct object optionally with a set of properties.

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

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 : 50

Function where list of properties are returned.

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

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>