$fieldgroups

Maintains collections of Fieldgroup object instances and represents the `$fieldgroups` API variable.

For full details on all methods available in a Fieldgroup, be sure to also see the WireArray class.


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

Show $var?     Show args?       Only hookable?    

Common

NameReturnSummary 
$fieldgroups->clone(Saveable $item)
Fieldgroup false

Create and return a cloned copy of this item

$fieldgroups->delete($item)
bool

Delete the given fieldgroup from the database

$fieldgroups->deleteField(Field $field)
bool

Delete the entries in fieldgroups_fields for the given Field

 
$fieldgroups->getAll()
FieldgroupsArray

Per WireSaveableItems interface, return all available Fieldgroup instances

 
$fieldgroups->getExportData(Fieldgroup $fieldgroup)
array

Export config data for the given fieldgroup

$fieldgroups->getFieldNames($fieldgroup)
array

Get all field names used by given fieldgroup

 
$fieldgroups->getLookupTable()
string

Per WireSaveableItemsLookup interface, return the name of the table that Fields are linked to Fieldgroups

 
$fieldgroups->getNumTemplates(Fieldgroup $fieldgroup)
int

Get the number of templates using the given fieldgroup.

 
$fieldgroups->getTable()
string

Per WireSaveableItems interface, return the name of the table that Fieldgroup instances are stored in

 
$fieldgroups->getTemplates(Fieldgroup $fieldgroup)
TemplatesArray

Given a Fieldgroup, return a TemplatesArray of all templates using the Fieldgroup

 
$fieldgroups->getWireArray()
WireArray FieldgroupsArray

@return WireArray|FieldgroupsArray

 
$fieldgroups->init()
None

Init

 
$fieldgroups->makeBlankItem()
Fieldgroup

Per WireSaveableItems interface, create a blank instance of a Fieldgroup

 
$fieldgroups->save(Saveable $item)
bool

Save the Fieldgroup to DB

$fieldgroups->saveContext(Fieldgroup $fieldgroup)
int

Save contexts for all fields in the given fieldgroup

$fieldgroups->setImportData(Fieldgroup $fieldgroup, array $data)
array

Given an export data array, import it back to the class and return what happened

For hooks

These methods are only useful for hooking and should not be called directly.

Additional methods and properties

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

API reference based on ProcessWire core version 3.0.253