Back to Pocketbase

Class Field

static/jsvm/classes/Field.html

latest4.0 KB
Original Source

Class Field

Field model class, usually used as part of the FieldsList model.

Hierarchy

Implements

Index

Constructors

constructor

Methods

columnTypegetHiddengetIdgetNamegetSystemprepareValuesetHiddensetIdsetNamesetSystemtypevalidateSettingsvalidateValue

Constructors

constructor

  • new Field(data?): Field

Parameters

Optional data: Partial<core.Field>

Returns Field

Methods

columnType

  • columnType(app): string

ColumnType returns the DB column definition of the field.

Parameters

app: App

Returns string

getHidden

  • getHidden(): boolean

GetHidden returns the field hidden flag state.

Returns boolean

getId

  • getId(): string

GetId returns the field id.

Returns string

getName

  • getName(): string

GetName returns the field name.

Returns string

getSystem

  • getSystem(): boolean

GetSystem returns the field system flag state.

Returns boolean

prepareValue

  • prepareValue(record, raw): any

PrepareValue returns a properly formatted field value based on the provided raw one.

This method is also called on record construction to initialize its default field value.

Parameters

record: core.Record
raw: any

Returns any

setHidden

  • setHidden(hidden): void

SetHidden changes the field hidden flag state.

Parameters

hidden: boolean

Returns void

setId

  • setId(id): void

SetId changes the field id.

Parameters

id: string

Returns void

setName

  • setName(name): void

SetName changes the field name.

Parameters

name: string

Returns void

setSystem

  • setSystem(system): void

SetSystem changes the field system flag state.

Parameters

system: boolean

Returns void

type

  • type(): string

Type returns the unique type of the field.

Returns string

validateSettings

  • validateSettings(ctx, app, collection): void

ValidateSettings validates the current field settings.

Parameters

ctx: context.Context
app: App
collection: core.Collection

Returns void

validateValue

  • validateValue(ctx, app, record): void

ValidateSettings validates the current field value associated with the provided record.

Parameters

ctx: context.Context
app: App
record: core.Record

Returns void

Settings

Member Visibility

  • Inherited

Theme

OSLightDark

On This Page

Generated using TypeDoc