SelectableOptionArray class

Located in file /wire/modules/Fieldtype/FieldtypeOptions/SelectableOptionArray.php

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

Show class?     Show args?       Only hookable?    

Common

NameReturnSummary 
SelectableOptionArray::addByID(int $id)
false SelectableOption

Add by option ID

 
SelectableOptionArray::addByTitle(string $title)
false SelectableOption

Add by option title

 
SelectableOptionArray::addByValue(string $value)
false SelectableOption

Add by option value

 
SelectableOptionArray::getByID(int $id)
SelectableOption null

Get option by ID

 
SelectableOptionArray::getByTitle(string $title)
SelectableOption null

Get option by title

 
SelectableOptionArray::getByValue(string $value)
SelectableOption null

Get option by value

 
SelectableOptionArray::getField()
null Field

Returns Field object these options are for

 
SelectableOptionArray::getItemKey($item)
None 
SelectableOptionArray::getPage()
NullPage Page

Returns page these options are for, if applicable (NullPage otherwise)

 
SelectableOptionArray::getProperty(string $property)
mixed null

Enables this WireArray to behave like the first item (for getting properties)

 
SelectableOptionArray::hasID(int $id)
SelectableOption bool

Is the given id present in these selectable options?

 
SelectableOptionArray::hasTitle(string $title)
SelectableOption bool

Is the given title present in these selectable options?

 
SelectableOptionArray::hasValue(string $value)
SelectableOption bool

Is the given value present in these selectable options?

 
SelectableOptionArray::isIdentical(WireArray $items)
bool

Is the given WireArray identical to this one?

 
SelectableOptionArray::isValidItem($item)
None 
SelectableOptionArray::isValidKey($key)
None 
SelectableOptionArray::makeBlankItem()
None 
SelectableOptionArray::of()
bool

Get or set output formatting mode

 
SelectableOptionArray::removeByID(int $id)
bool

Remove option by ID

 
SelectableOptionArray::removeByTitle(string $title)
bool

Remove option by title

 
SelectableOptionArray::removeByValue(string $value)
bool

Remove option by value

 
SelectableOptionArray::render()
string

Provide a default string rendering of these selectable options

 
SelectableOptionArray::set($key, $value)
None 
SelectableOptionArray::setField(Field $field)
None

Set the field these options are for

 
SelectableOptionArray::setPage(Page $page)
None

Set the these options live on

 
SelectableOptionArray::setProperty(string $property, mixed $value)
SelectableOption SelectableOptionArray

Enables this WireArray to behave like the first item (for setting properties)

 

Properties

NameReturnSummary 
SelectableOptionArray::id int 
SelectableOptionArray::title string 
SelectableOptionArray::value string 

Additional methods and properties

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

API reference based on ProcessWire core version 3.0.252