Skip to main content
Version: Next

Class: BaseEntity<T, PK, P\>

core.BaseEntity

Type parameters#

NameTypeDefault
T--
PKkeyof T-
PPopulate<T> | unknownunknown

Implements#

Constructors#

constructor#

+ new BaseEntity<T, PK, P>(): BaseEntity<T, PK, P>

Type parameters#

NameTypeDefault
T--
PKstring | number | symbol-
Punknownunknown

Returns: BaseEntity<T, PK, P>

Defined in: packages/core/src/entity/BaseEntity.ts:5

Methods#

assign#

assign(data: EntityData<T>, options?: AssignOptions): T

Parameters#

NameType
dataEntityData<T>
options?AssignOptions

Returns: T

Implementation of: IWrappedEntity

Defined in: packages/core/src/entity/BaseEntity.ts:35


init#

init(populated?: boolean): Promise<T>

Parameters#

NameTypeDefault value
populatedbooleantrue

Returns: Promise<T>

Implementation of: IWrappedEntity

Defined in: packages/core/src/entity/BaseEntity.ts:39


isInitialized#

isInitialized(): boolean

Returns: boolean

Implementation of: IWrappedEntity

Defined in: packages/core/src/entity/BaseEntity.ts:11


populated#

populated(populated?: boolean): void

Parameters#

NameTypeDefault value
populatedbooleantrue

Returns: void

Implementation of: IWrappedEntity

Defined in: packages/core/src/entity/BaseEntity.ts:15


toJSON#

toJSON(...args: any[]): EntityDTO<T>

Parameters#

NameType
...argsany[]

Returns: EntityDTO<T>

Implementation of: IWrappedEntity

Defined in: packages/core/src/entity/BaseEntity.ts:27


toObject#

toObject(ignoreFields?: string[]): EntityDTO<T>

Parameters#

NameTypeDefault value
ignoreFieldsstring[][]

Returns: EntityDTO<T>

Implementation of: IWrappedEntity

Defined in: packages/core/src/entity/BaseEntity.ts:23


toPOJO#

toPOJO(): EntityDTO<T>

Returns: EntityDTO<T>

Implementation of: IWrappedEntity

Defined in: packages/core/src/entity/BaseEntity.ts:31


toReference#

toReference(): any

Returns: any

Implementation of: IWrappedEntity

Defined in: packages/core/src/entity/BaseEntity.ts:19