Back to Trilium

Class AbstractBeccaEntity<T>Abstract

docs/Script API/classes/Backend_Script_API.AbstractBeccaEntity.html

0.102.25.4 KB
Original Source

Class AbstractBeccaEntity<T>Abstract

Base class for all backend entities.

Type Parameters

  • T extends AbstractBeccaEntity<T>

Hierarchy (View Summary)

Index

Constructors

constructor

Properties

blobId?dateCreated?dateModified?isProtected?isSynced?utcDateCreatedutcDateModified?

Accessors

beccaisDeleted

Methods

_getContent_setContentbeforeSavinggenerateHashgetPojogetPojoToSavegetUtcDateChangedhasStringContentinitmarkAsDeletedmarkAsDeletedSimpleputEntityChangesaveupdateFromRow

Constructors

constructor

new AbstractBeccaEntity<T extends AbstractBeccaEntity<T>>(): AbstractBeccaEntity<
T,
>

Type Parameters

  • T extends AbstractBeccaEntity<T>

Returns AbstractBeccaEntity<T>

Properties

OptionalblobId

blobId?: string

OptionaldateCreated

dateCreated?: string

OptionaldateModified

dateModified?: string

OptionalisProtected

isProtected?: boolean

OptionalisSynced

isSynced?: boolean

utcDateCreated

utcDateCreated: string

OptionalutcDateModified

utcDateModified?: string

Accessors

Protectedbecca

get becca(): default

Returns default

isDeleted

get isDeleted(): boolean

Returns boolean

Methods

Protected_getContent

_getContent(): string | Buffer<ArrayBufferLike>

Returns string | Buffer<ArrayBufferLike>

Protected_setContent

_setContent(content: string | Buffer<ArrayBufferLike>, opts?: ContentOpts): void

Parameters

Returns void

ProtectedbeforeSaving

beforeSaving(opts?: {}): void

Parameters

  • Optionalopts: {}

Returns void

generateHash

generateHash(isDeleted?: boolean): string

Parameters

  • OptionalisDeleted: boolean

Returns string

AbstractgetPojo

getPojo(): {}

Returns {}

ProtectedgetPojoToSave

getPojoToSave(): {}

Returns {}

getUtcDateChanged

getUtcDateChanged(): string

Returns string

hasStringContent

hasStringContent(): boolean

Returns boolean

init

init(): void

Returns void

markAsDeleted

markAsDeleted(deleteId?: null | string): void

Mark the entity as (soft) deleted. It will be completely erased later.

This is a low-level method, for notes and branches use note.deleteNote() and 'branch.deleteBranch()` instead.

Parameters

  • deleteId: null | string = null

Returns void

markAsDeletedSimple

markAsDeletedSimple(): void

Returns void

ProtectedputEntityChange

putEntityChange(isDeleted: boolean): void

Parameters

  • isDeleted: boolean

Returns void

save

save(opts?: {}): this

Saves entity - executes SQL, but doesn't commit the transaction on its own

Parameters

  • Optionalopts: {}

Returns this

AbstractupdateFromRow

updateFromRow(row: unknown): void

Parameters

  • row: unknown

Returns void

Settings

Member Visibility

  • Protected
  • Inherited
  • External

ThemeOSLightDark

On This Page

Constructors constructor Properties blobIddateCreateddateModifiedisProtectedisSyncedutcDateCreatedutcDateModified Accessors beccaisDeleted Methods _getContent_setContentbeforeSavinggenerateHashgetPojogetPojoToSavegetUtcDateChangedhasStringContentinitmarkAsDeletedmarkAsDeletedSimpleputEntityChangesaveupdateFromRow