class SetMetadataField extends MetadataFieldList

Represents a metadata field with 'Set' (multi-selection list) type.

Methods

jsonSerialize()

No description

__construct(string $label, array|MetadataDataSource $dataSource = [])

The SetMetadataField constructor.

getPropertyKeys()

Gets the keys for all the properties of this object.

getType()

Returns the type of this field.

getDefaultValue()

Gets the default value of this field.

setDefaultValue(mixed $defaultValue)

Sets the default value of this field.

getExternalId()

Gets the ID of this field.

setExternalId(string $externalId)

Sets the ID of the string (auto-generated if this is left blank).

getLabel()

Gets the label of this field.

setLabel(string $label)

Sets the label of this field.

getMandatory()

Gets a boolean indicating whether this fields is currently mandatory.

setMandatory(bool $mandatory = true)

Sets whether this field needs to be mandatory.

getValidation()

Gets the validation rules of this field.

setValidation(MetadataValidation $validation)

Sets the validation rules of this field.

getRestrictions()

Gets the restrictions of this field.

setRestrictions(array $restrictions)

Sets the restrictions of this field.

isDefaultDisabled()

Gets the value indicating whether the field should be disabled by default.

setDefaultDisabled(bool $defaultDisabled = true)

Sets the value indicating whether the field should be disabled by default.

getDataSource()

Gets the data source of this field.

setDataSource(array|MetadataDataSource $metadataDataSource)

Sets the data source for this field.

Details

jsonSerialize()

__construct(string $label, array|MetadataDataSource $dataSource = [])

The SetMetadataField constructor.

Parameters

Name Type Description
$label string
$dataSource array|MetadataDataSource

string[] getPropertyKeys()

Gets the keys for all the properties of this object.

Return Value

string[]

string getType()

Returns the type of this field.

Return Value

string The type name.

mixed getDefaultValue()

Gets the default value of this field.

Return Value

mixed

setDefaultValue(mixed $defaultValue)

Sets the default value of this field.

Parameters

Name Type Description
$defaultValue mixed

string getExternalId()

Gets the ID of this field.

Return Value

string The field ID.

setExternalId(string $externalId)

Sets the ID of the string (auto-generated if this is left blank).

Parameters

Name Type Description
$externalId string The ID to set.

string getLabel()

Gets the label of this field.

Return Value

string The label of the field.

setLabel(string $label)

Sets the label of this field.

Parameters

Name Type Description
$label string The label to set.

bool getMandatory()

Gets a boolean indicating whether this fields is currently mandatory.

Return Value

bool A boolean indicating whether the field is mandatory.

setMandatory(bool $mandatory = true)

Sets whether this field needs to be mandatory.

Parameters

Name Type Description
$mandatory bool A boolean indicating whether the field should be mandatory.

MetadataValidation getValidation()

Gets the validation rules of this field.

Return Value

MetadataValidation The validation rules.

setValidation(MetadataValidation $validation)

Sets the validation rules of this field.

Parameters

Name Type Description
$validation MetadataValidation The rules to set.

array getRestrictions()

Gets the restrictions of this field.

Return Value

array

setRestrictions(array $restrictions)

Sets the restrictions of this field.

Parameters

Name Type Description
$restrictions array

bool isDefaultDisabled()

Gets the value indicating whether the field should be disabled by default.

Return Value

bool

setDefaultDisabled(bool $defaultDisabled = true)

Sets the value indicating whether the field should be disabled by default.

Parameters

Name Type Description
$defaultDisabled bool The value to set.

MetadataDataSource getDataSource()

Gets the data source of this field.

Return Value

MetadataDataSource The data source.

setDataSource(array|MetadataDataSource $metadataDataSource)

Sets the data source for this field.

Parameters

Name Type Description
$metadataDataSource array|MetadataDataSource The data source to set.

Exceptions

InvalidArgumentException