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)
FieldReturn a cloned copy of $field
FieldtypeFile::deleteField(Field $field)
boolDelete field
FieldtypeFile::deletePageField(Page $page, Field $field)
boolDelete field from page
FieldtypeFile::emptyPageField(Page $page, Field $field)
boolEmpty field from page
FieldtypeFile::exportValue(Page $page, Field $field, $value)
array float int stringExport value
FieldtypeFile::formatValue(Page $page, Field $field, Pagefiles $value)
Pagefiles PagefilePerform output formatting on the value delivered to the API
FieldtypeFile::get($key)
None 
FieldtypeFile::getBlankValue(Page $page, Field $field)
PagefilesGet blank value 
FieldtypeFile::getCompatibleFieldtypes(Field $field)
FieldtypesGet compatible Fieldtypes
FieldtypeFile::getConfigAdvancedInputfields(Field $field)
InputfieldWrapperField advanced config
FieldtypeFile::getConfigInputfields(Field $field)
InputfieldWrapperField config
FieldtypeFile::getDatabaseSchema(Field $field)
arrayGet database schema 
FieldtypeFile::getFieldSetups()
arrayGet setup options and setup functions for new fields
FieldtypeFile::getFilesPath(Page $page, Field $field)
stringGet path where files are (or would be) stored 
FieldtypeFile::getInputfield(Page $page, Field $field)
InputfieldGet the Inputfield module to handle input for this Fieldtype 
FieldtypeFile::getLoadQueryAutojoin(Field $field, DatabaseQuerySelect $query)
DatabaseQuerySelect nullDisable autojoin for files 
FieldtypeFile::getMatchQuery($query, string $table, string $subfield, string $operator, mixed $value)
DatabaseQuery DatabaseQuerySelectGet match query 
FieldtypeFile::getPagefile(Page $page, string $basename)
Pagefile nullGiven a Page and file basename, return the Pagefile object if file is found for Page 
FieldtypeFile::getPagefiles(Page $page, Field $field)
PagefilesGet Pagefiles 
FieldtypeFile::getSelectorInfo(Field $field)
arrayGet selector info
FieldtypeFile::getValidFileExtensions($field)
arrayCheck 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 MarkupFieldtypeRender a markup string of the value.
FieldtypeFile::renamedField(Field $field, string $prevName)
NoneCalled after field renamed
FieldtypeFile::sanitizeValue(Page $page, Field $field, mixed $value)
PagefilesSanitize value 
FieldtypeFile::sleepValue(Page $page, Field $field, $value)
arrayGiven 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 nullGiven a raw value (value as stored in DB), return the value as it would appear in a Page object

Properties

NameReturnSummaryDefault
FieldtypeFile::allowFieldtypes array Allowed Fieldtype types for custom fields 
FieldtypeFile::defaultFileExtensions string Default file extensions 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.251