FieldtypeOptions class

Field that stores single and multi select options.

Click any linked item for full usage details and examples. Hookable methods are indicated with the icon. In addition to those shown below, the FieldtypeOptions class also inherits all the methods and properties of: FieldtypeMulti, Fieldtype, WireData and Wire.

Show class?     Show args?       Only hookable?    

Common

NameReturnSummary 
FieldtypeOptions::addOptions($field, SelectableOptionArray $options)
int

Add the given new options

 
FieldtypeOptions::cloneField(Field $field)
Field

Return a cloned copy of $field

FieldtypeOptions::deleteField(Field $field)
bool

Delete the given field

FieldtypeOptions::deleteOptions($field, SelectableOptionArray $options)
int

Delete the given options

 
FieldtypeOptions::exportConfigData(Field $field, array $data)
array

Export configuration values for external consumption

FieldtypeOptions::formatValue(Page $page, Field $field, SelectableOptionArray $value)
SelectableOptionArray

Prep a value for front-end output

FieldtypeOptions::get(string $key)
mixed SelectableOptionManager

Get a property from the Fieldtype

 
FieldtypeOptions::getBlankValue(Page $page, Field $field)
SelectableOptionArray

Get a blank SelectableOptionArray

 
FieldtypeOptions::getCompatibleFieldtypes(Field $field)
Fieldtypes

Get Fieldtypes that are known compatible with this one

FieldtypeOptions::getConfigInputfields(Field $field)
InputfieldWrapper

Get Inputfields needed to configure this Fieldtype

FieldtypeOptions::getDatabaseSchema(Field $field)
array

Get schema for the Fieldtype's database table

 
FieldtypeOptions::getFieldSetups()
array

Get setup options and setup functions for new fields

FieldtypeOptions::getInputfield(Page $page, Field $field)
Inputfield

Get the Inputfield that provides input for this Fieldtype

 
FieldtypeOptions::getMatchQuery(PageFinderDatabaseQuerySelect $query, string $table, string $subfield, string $operator, mixed $value)
DatabaseQuery

Update a database query for finding values from this Fieldtype

 
FieldtypeOptions::getOptions($field)
SelectableOptionArray

Get all options available for the given field

 
FieldtypeOptions::getSelectorInfo(Field $field)
array

Get information used for InputfieldSelector interactive selector builder

FieldtypeOptions::importConfigData(Field $field, array $data)
array

Convert an array of exported data to a format that will be understood internally (opposite of exportConfigData)

FieldtypeOptions::markupValue(Page $page, Field $field)
string

Render a markup string of the value

FieldtypeOptions::sanitizeValue(Page $page, Field $field, mixed $value)
SelectableOptionArray

Sanitize value for storage in a page

 
FieldtypeOptions::setOptions($field, SelectableOptionArray $options)
array

Update, add, delete as needed to match the given $options

 
FieldtypeOptions::sleepValue(Page $page, Field $field, SelectableOptionArray $value)
array

Prep value for DB storage

FieldtypeOptions::upgrade(string $fromVersion, string $toVersion)
None

Upgrade module version

 
FieldtypeOptions::wakeupValue(Page $page, Field $field, array $value)
SelectableOptionArray

Prep value from DB for storage in Page

FieldtypeOptions::wired()
None 

Properties

NameReturnSummary 
FieldtypeOptions::manager SelectableOptionManager 

Additional methods and properties

In addition to the methods and properties above, FieldtypeOptions also inherits the methods and properties of these classes:

API reference based on ProcessWire core version 3.0.253