FieldtypeTable class

Field that lets you define a database table of custom fields.

Part of the ProFields package Please do not distribute.

Copyright 2024 by Ryan Cramer


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

Show class?     Show args?       Only hookable?    

Common

NameReturnSummary 
FieldtypeTable::adjustColumnSetting(string $setting, string $settingValue)
string

Analyze and update a column setting if it needs anything

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

Delete the given Field from the given Page.

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

Export table rows value for a page to an array

FieldtypeTable::fieldHasFileColumns(Field $field)
bool

Does given field have any file-type columns?

 
FieldtypeTable::findColumns(Field $field, string $property, $value)
array

Find columns having property that matches value

 
FieldtypeTable::formatValue(Page $page, Field $field, TableRows $value)
TableRows

Format Table value for front-end output

FieldtypeTable::getArrayClass($field)
string

Get class to use for TableRows WireArray instances

 
FieldtypeTable::getBlankValue(Page $page, Field $field)
TableRows

Return a blank TableRows value

 
FieldtypeTable::getColTypes()
array

@return array

 
FieldtypeTable::getColumn(Field $field, $n)
array

Get an individual column by number (1 or higher) or name

 
FieldtypeTable::getColumnByName(Field $field, string $name)
array

Get an individual column by name (only)

 
FieldtypeTable::getColumns(Field $field)
array

Get an array of all columns indexed by colum number

 
FieldtypeTable::getColumnsByName(Field $field)
array

Get an array of all columns indexed by name

 
FieldtypeTable::getCompatibleFieldtypes(Field $field)
Fieldtypes

There are no other fieldtypes compatible with this one

FieldtypeTable::getConfigInputfields(Field $field)
InputfieldWrapper

Configure the FieldtypeTable for details tab

FieldtypeTable::getDatabaseSchema(Field $field)
array

Return the DB schema used by Table

 
FieldtypeTable::getFieldClass()
string

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

 
FieldtypeTable::getFiles(Page $page, Field $field)
array

Get array of full path/file for all files managed by given page and field

 
FieldtypeTable::getFilesPath(Page $page, Field $field)
string

Get path where files are (or would be) stored

 
FieldtypeTable::getInputfield(Page $page, Field $field)
Inputfield InputfieldTable

Return the Inputfield used for inputting Table data

 
FieldtypeTable::getLoadQueryAutojoin(Field $field, DatabaseQuerySelect $query)
DatabaseQuerySelect null

Return the query used for Autojoining this field (if different from getLoadQuery) or NULL if autojoin not

 
FieldtypeTable::getMatchQuery(PageFinderDatabaseQuerySelect $query, string $table, string $subfield, string $operator, string $value)
DatabaseQuerySelect DatabaseQuery

Update a DatabaseQuerySelect object to match a Page

 
FieldtypeTable::getRowClass($field)
string

Get class to use for TableRow instances

 
FieldtypeTable::getSelectColumnOptions(Field $field, $col)
array

Get array of [ value => title ] for select column options

 
FieldtypeTable::getSelectorInfo(Field $field)
array

Get information for use in selectors

FieldtypeTable::hasFiles(Page $page, Field $field)
bool

Whether or not given Page/Field has any files connected with it

 
FieldtypeTable::importValue(Page $page, Field $field, array $value)
WireData

Import a previously exported array

FieldtypeTable::loadPageField(Page $page, Field $field)
array null

Extend loadPageField to support pagination

FieldtypeTable::markupValue(Page $page, Field $field)
string MarkupFieldtype

Render a markup string of the value

FieldtypeTable::newLanguagesPageFieldValue(Page $page, Field $field)
LanguagesPageFieldValue

Return a new LanguagesPageFieldValue

 
FieldtypeTable::porter()
FieldtypeTablePorter

@return FieldtypeTablePorter

 
FieldtypeTable::reorder(Field $field)
None

Reorder our field definitions to be consistent with their sort orders

 
FieldtypeTable::sanitizeFieldName(string $fieldName)
string

Sanitize a field name

 
FieldtypeTable::sanitizeTextTags(array $col, $value)
string

Sanitize TextTags value

 
FieldtypeTable::sanitizeValue(Page $page, Field $field, TableRows $value)
TableRows

Sanitize and validate value any time it is set to a Page

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

Save a page field

FieldtypeTable::sessionData(Page $page, Field $field)
array

Get or set session data

 
FieldtypeTable::sleepColumn(array $col, $itemValue)
mixed

Sleep a column value for storage or query

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

Given a TableRows object, convert it to an array for storage

FieldtypeTable::wakeupFile(Page $page, Field $field, $value, string $type)
Pagefile Pageimage null

Wakeup a filename/basename to a Pagefile/Pageimage

 
FieldtypeTable::wakeupValue(Page $page, Field $field, array $value)
TableRows

Given a value from the DB, wake it up to a TableRows object

FieldtypeTable::wired()
None

Wired to API

 

Additional methods and properties

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

API reference based on ProcessWire core version 3.0.259