FieldtypeFile class

Field that stores one or more files with optional description.

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

Show class?     Show args?       Only hookable?    

Common

NameReturnSummary 
FieldtypeFile::cloneField(Field $field)
Field

Return a cloned copy of $field

FieldtypeFile::deleteField(Field $field)
bool

Delete field

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

Delete field from page

FieldtypeFile::emptyPageField(Page $page, Field $field)
bool

Empty field from page

FieldtypeFile::exportValue(Page $page, Field $field, $value)
array float int string

Export value

FieldtypeFile::formatValue(Page $page, Field $field, Pagefiles $value)
Pagefiles Pagefile

Perform output formatting on the value delivered to the API

FieldtypeFile::get($key)
None 
FieldtypeFile::getBlankValue(Page $page, Field $field)
Pagefiles

Get blank value

 
FieldtypeFile::getCompatibleFieldtypes(Field $field)
Fieldtypes

Get compatible Fieldtypes

FieldtypeFile::getConfigAdvancedInputfields(Field $field)
InputfieldWrapper

Field advanced config

FieldtypeFile::getConfigInputfields(Field $field)
InputfieldWrapper

Field config

FieldtypeFile::getDatabaseSchema(Field $field)
array

Get database schema

 
FieldtypeFile::getFieldSetups()
array

Get setup options and setup functions for new fields

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

Get path where files are (or would be) stored

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

Get the Inputfield module to handle input for this Fieldtype

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

Disable autojoin for files

 
FieldtypeFile::getMatchQuery($query, string $table, string $subfield, string $operator, mixed $value)
DatabaseQuery DatabaseQuerySelect

Get match query

 
FieldtypeFile::getPagefile(Page $page, string $basename)
Pagefile null

Given a Page and file basename, return the Pagefile object if file is found for Page

 
FieldtypeFile::getPagefiles(Page $page, Field $field)
Pagefiles

Get Pagefiles

 
FieldtypeFile::getSelectorInfo(Field $field)
array

Get selector info

FieldtypeFile::getValidFileExtensions($field)
array

Check file extensions for given field and return array of validity information

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

@param Page $page

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

Render a markup string of the value.

FieldtypeFile::renamedField(Field $field, string $prevName)
None

Called after field renamed

FieldtypeFile::sanitizeValue(Page $page, Field $field, mixed $value)
Pagefiles

Sanitize value

 
FieldtypeFile::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.

FieldtypeFile::wakeupValue(Page $page, Field $field, $value)
Pagefiles null

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

Properties

NameReturnSummary 
FieldtypeFile::allowFieldtypes array Allowed Fieldtype types for custom fields 
FieldtypeFile::defaultFileExtensions string Default file extensions
DEFAULT: pdf doc docx xls xlsx gif jpg jpeg png
 

Additional methods and properties

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

API reference based on ProcessWire core version 3.0.253