ContentType
class ContentType extends BaseResource implements ContentTypeInterface
Content Types are schemas that define the fields of Entries. Every Entry can only contain values in the fields defined by its Content Type, and the values of those fields must match the data type defined in the Content Type.
Properties
| protected ContentType | $sys | ||
| protected string | $name | Name of the Content Type. | |
| protected string|null | $description | Description of the Content Type. | |
| protected Field[] | $fields | The fields, keyed by ID. | |
| protected string|null | $displayField | ID of main field used for display. | 
Methods
Resources in this SDK should not be built using $new Class().
{@inheritdoc}
Returns the environment this content type belongs to.
Returns the name of this content type.
Returns the content type's description.
Returns the field for the passed id.
Returns the the display field of a content type. Commonly this is the title.
Adds a runtime field, of type unknown.
{@inheritdoc}
Details
        in BaseResource at         line 26
                    protected        
    __construct(array $data)
        
    
    Resources in this SDK should not be built using $new Class().
This method is only useful in testing environments, where the resource needs to be subclasses and this method made public.
        in BaseResource at         line 38
                            
    asLink()
        
    
    {@inheritdoc}
        in BaseResource at         line 49
                            
    getId()
        
    
    {@inheritdoc}
        in BaseResource at         line 57
                            
    getType()
        
    
    {@inheritdoc}
        at         line 60
                            
    getSystemProperties()
        
    
    {@inheritdoc}
        at         line 70
                            Space
    getSpace()
        
    
    Returns the space this content type belongs to.
        at         line 80
                            Environment
    getEnvironment()
        
    
    Returns the environment this content type belongs to.
        at         line 90
                            string
    getName()
        
    
    Returns the name of this content type.
        at         line 101
                            Field[]
    getFields()
        
    
    Returns all the fields of this content type as an associative array.
The key is the ID of the field.
        at         line 111
                            string|null
    getDescription()
        
    
    Returns the content type's description.
        at         line 126
                            Field|null
    getField(string $fieldId, bool $tryCaseInsensitive = \false)
        
    
    Returns the field for the passed id.
If the field does not exist, null is returned.
        at         line 150
                            Field|null
    getDisplayField()
        
    
    Returns the the display field of a content type. Commonly this is the title.
Returns null if not display field is set.
        at         line 166
                            Field
    addUnknownField(string $name)
        
    
    Adds a runtime field, of type unknown.
        at         line 176
                            
    jsonSerialize()
        
    
    {@inheritdoc}