This class is used for creating a new content object.
Properties¶
                 $alwaysAvailable
            ¶
        $alwaysAvailable
            ¶
    
        Indicates if the content object is shown in the mainlanguage if its not present in an other requested language.
|  |  | 
                 $contentType
            ¶
        $contentType
            ¶
    
        The content type for which the new content is created.
|  |  | 
Required.
                 $fields
            ¶
        $fields
            ¶
    
        |  |  | 
                 $mainLanguageCode
            ¶
        $mainLanguageCode
            ¶
    
        the main language code for the content. This language will also be used for as initial language for the first created version.
|  |  | 
It is also used as default language for added fields.
Required.
                 $modificationDate
            ¶
        $modificationDate
            ¶
    
        Modification date. If not given the current timestamp is used.
|  |  | 
                 $ownerId
            ¶
        $ownerId
            ¶
    
        The owner of the content. If not given the current authenticated user is set as owner.
|  |  | 
                 $remoteId
            ¶
        $remoteId
            ¶
    
        Remote identifier used as a custom identifier for the object.
|  |  | 
Needs to be a unique Content->remoteId string value.
                 $sectionId
            ¶
        $sectionId
            ¶
    
        The section the content is assigned to.
|  |  | 
If not set the section of the parent is used or a default section.
Methods¶
                 __construct()
            ¶
__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> | [] | - | 
                 setField()
            ¶
setField()
            ¶
    
        |  |  | 
Parameters
| Name | Type | Default value | Description | 
|---|---|---|---|
| $fieldDefIdentifier | string | - | - | 
| $value | mixed | - | - | 
| $language | string|null | null | - | 
                 getProperties()
            ¶
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>