Craft 3 Class Reference

Trait craft\base\MissingComponentTrait

Implemented by
craft\fields\MissingField, craft\volumes\MissingVolume, craft\widgets\MissingWidget
Available since version
3.0
Source Code
https://github.com/craftcms/cms/blob/master/src/base/MissingComponentTrait.php

MissingComponentTrait implements the common methods and properties for classes implementing craft\base\MissingComponentInterface.

Public Properties
Property Type Description Defined By
$errorMessage string, null The exception message that explains why the component class was invalid craft\base\MissingComponentTrait
$expectedType string, craft\base\Component, null The expected component class name. craft\base\MissingComponentTrait
$settings mixed The custom settings associated with the component, if it is savable craft\base\MissingComponentTrait
Public Methods
Method Description Defined By
createFallback() Creates a new component of a given type based on this one’s properties. craft\base\MissingComponentTrait

Property Details

$errorMessage public property #

The exception message that explains why the component class was invalid

public string, null $errorMessage null

$expectedType public property #

The expected component class name.

public string, craft\base\Component, null $expectedType null

$settings public property #

The custom settings associated with the component, if it is savable

public mixed $settings null

Method Details

createFallback() public method #

Creates a new component of a given type based on this one’s properties.

public craft\base\ComponentInterface createFallback ( \craft\base\string $type )
$type string The component class that should be used as the fallback