OptionData
- Type
- Class
- Namespace
- craft\fields\data
- Inherits
- craft\fields\data\OptionData
- Implements
- craft\base\Serializable
- Extended by
- craft\fields\data\SingleOptionFieldData
- Since
- 3.0.0
Class OptionData
View source (opens new window)
# Public Properties
# label
- Type
- string (opens new window), null (opens new window)
- Default value
null
View source (opens new window)
# selected
- Type
- boolean (opens new window)
- Default value
null
View source (opens new window)
# valid
- Type
- boolean (opens new window)
- Default value
null
- Since
- 3.5.10
View source (opens new window)
# value
- Type
- string (opens new window), null (opens new window)
- Default value
null
View source (opens new window)
# Public Methods
Method | Description |
---|---|
__construct() | Constructor |
__toString() | |
serialize() | Returns the object’s serialized value. |
# __construct()
Constructor
View source (opens new window)
Arguments
$label
(string (opens new window), null (opens new window))$value
(string (opens new window), null (opens new window))$selected
(boolean (opens new window))$valid
(boolean (opens new window))
# __toString()
View source (opens new window)
Returns
# serialize()
Returns the object’s serialized value.
View source (opens new window)
Returns
mixed
– The serialized value