SelectableOptionManager class

Handles management of the fieldtype_options table and related field_[name] table

to assist FieldtypeOptions module.


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

Show class?     Show args?       Only hookable?    

Common

NameReturnSummary 
SelectableOptionManager::addOptions(Field $field, $options)
int

Add the given option titles for $field

 
SelectableOptionManager::deleteAllOptionsForField(Field $field)
int

Delete all options for given field

 
SelectableOptionManager::deleteOptions(Field $field, $options)
int

Delete the given options for $field

 
SelectableOptionManager::deleteOptionsByID(Field $field, array $ids)
int

Delete the given option IDs

 
SelectableOptionManager::findOptionsByProperty(Field $field, string $property, string $operator, string $value)
SelectableOptionArray

Perform a partial match on title of options

 
SelectableOptionManager::getOptions(Field $field)
SelectableOptionArray SelectableOption

Return array of current options for $field

 
SelectableOptionManager::getOptionsByID(Field $field, array $ids)
SelectableOptionArray SelectableOption

Shortcut to get options by ID number

 
SelectableOptionManager::getOptionsString(SelectableOptionArray $options)
string

Get the options input string used for

 
SelectableOptionManager::getRemovedOptionIDs()
array

Return the option IDs found to have been removed from the last setOptions() call.

 
SelectableOptionManager::install()
None

Install

 
SelectableOptionManager::setOptions(Field $field, $options)
array

Set current options for $field, identify and acting on added, deleted, updated options

 
SelectableOptionManager::setOptionsString(Field $field, string $value)
array

Set an options string

 
SelectableOptionManager::setOptionsStringLanguages(Field $field, array $values)
None

Set options string, but for each language

 
SelectableOptionManager::uninstall()
None

Uninstall

 
SelectableOptionManager::updateLanguages()
None

Hook method called when a language is added or deleted

 
SelectableOptionManager::updateOptions(Field $field, $options)
int

Update options for field

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

Upgrade fieldtype_options table

 
SelectableOptionManager::useLanguages()
bool

Whether or not multi-language support is in use

 
SelectableOptionManager::wired()
None 

Additional methods and properties

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

API reference based on ProcessWire core version 3.0.253