FieldtypeRepeater class

Maintains a collection of fields that are repeated for any number of times.

For documentation about how Fieldtypes work, see: wire/core/Fieldtype.php wire/core/FieldtypeMulti.php

Page status notes for repeater items:

  • Unpublished & Hidden: Ready page, not yet used. Appears in unformatted repeater PageArray but user has not saved it.
  • Unpublished & On: Publish requested and can be published as long as no input errors.
  • Unpublished & NOT On: Item has been unpublished.

Unpublished or hidden pages do not appear in formatted PageArray value, only in unformatted.


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

Show class?     Show args?       Only hookable?    

Common

NameReturnSummary 
FieldtypeRepeater::cloneField(Field $field)
None

Create a cloned copy of Field

FieldtypeRepeater::countOldReadyPages(Field $field)
int

Count or delete old ready pages that are just taking up space

 
FieldtypeRepeater::deleteField(Field $field)
bool

Delete the given field, which implies: drop the table $field->table

FieldtypeRepeater::deletePageField(Page $page, Field $field)
bool

Delete the given Field from the given Page

FieldtypeRepeater::deleteRepeaterPage(Page $page)
int

Delete a repeater page, removing system statuses first

 
FieldtypeRepeater::exportValue(Page $page, Field $field, RepeaterPageArray $value)
array

Export repeater value

FieldtypeRepeater::findUnnecessaryParents(Field $field)
PageArray

Find unnecessary parent pages that may be deleted

 
FieldtypeRepeater::formatValue(Page $page, Field $field, PageArray $value)
PageArray

Perform output formatting on the value delivered to the API

FieldtypeRepeater::getBlankRepeaterPage(Page $page, Field $field)
Page

Returns a blank page ready for use as a repeater

 
FieldtypeRepeater::getBlankValue(Page $page, Field $field)
PageArray RepeaterPageArray

Get a blank value of this type, i.e. return a blank PageArray

 
FieldtypeRepeater::getCompatibleFieldtypes(Field $field)
WireArray

FieldtypeRepeater instances are only compatible with other FieldtypeRepeater derived classes.

FieldtypeRepeater::getConfigAdvancedInputfields(Field $field)
InputfieldWrapper

Remove advanced options that aren't supposed with repeaters

FieldtypeRepeater::getConfigInputfields(Field $field)
InputfieldWrapper

Return configuration fields definable for each FieldtypePage

FieldtypeRepeater::getCustomPageClass(Field $field)
string

Get custom RepeaterPage class for given repeater field

 
FieldtypeRepeater::getDatabaseSchema(Field $field)
array

Return the database schema in predefined format

 
FieldtypeRepeater::getFieldClass()
string

Get class name to use Field objects of this type (must be class that extends Field class)

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

Return an InputfieldRepeater, ready to be used

 
FieldtypeRepeater::getMatchQuery(PageFinderDatabaseQuerySelect $query, string $table, string $subfield, string $operator, string $value)
PageFinderDatabaseQuerySelect

Update a DatabaseQuerySelect object to match a Page

 
FieldtypeRepeater::getNextReadyPage(Page $page, Field $field)
Page

Get next page ready to be used as a new repeater item, creating it if it doesn't already exist

 
FieldtypeRepeater::getPageArrayClass()
string

Get the class used for repeater PageArray objects

 
FieldtypeRepeater::getPageClass()
string

Get the class used for repeater Page objects

 
FieldtypeRepeater::getRepeaterConfigHelper(Field $field)
FieldtypeRepeaterConfigHelper

@param Field $field

 
FieldtypeRepeater::getRepeaterPageParent(Page $page, Field $field)
Page NullPage

Return the parent used by the repeater pages for the given Page and Field

 
FieldtypeRepeater::getRepeaterParent(Field $field)
Page

Return the repeater parent used by $field, i.e. /processwire/repeaters/for-field-123/

 
FieldtypeRepeater::getRepeatersRootPage()
Page

Get repeaters root page

 
FieldtypeRepeater::getSelectorInfo(Field $field)
array

Get information used by selectors for querying this field

FieldtypeRepeater::getUniqueRepeaterPageName()
string

Returns a unique name for a repeater page

 
FieldtypeRepeater::importValue(Page $page, Field $field, array $value)
bool PageArray

Import repeater value previously exported by exportValue()

FieldtypeRepeater::initAllFields()
None

Force initialize of all repeater fields, confirming their configuration settings are correct

 
FieldtypeRepeater::porter()
FieldtypeRepeaterPorter

@return FieldtypeRepeaterPorter

 
FieldtypeRepeater::sanitizeValue(Page $page, Field $field, mixed $value)
PageArray RepeaterPageArray

Handles the sanitization and convertion to PageArray value

 
FieldtypeRepeater::sanitizeValueString(Page $page, Field $field, string $value)
Page PageArray

Given a string value return a Page or PageArray

 
FieldtypeRepeater::savePageField(Page $page, Field $field)
bool

Save the given field from page

FieldtypeRepeater::setCustomPageClass(Field $field, string $class)
None

Set custom RepeaterPage class for given field

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

Given an 'awake' value, as set by wakeupValue, convert the value back to a basic type for storage in DB.

FieldtypeRepeater::useLazyParents($field)
bool

Use lazy parents mode?

 
FieldtypeRepeater::wakeupValue(Page $page, Field $field, array $value)
PageArray

Given a raw value (value as stored in DB), return the value as it would appear in a Page object

Properties

NameReturnSummary 
FieldtypeRepeater::repeatersRootPageID int 

Additional methods and properties

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

API reference based on ProcessWire core version 3.0.252