QPaginatedEntity
@quik/entity / QPaginatedEntity
Class: QPaginatedEntity<TEntity>
Defined in: entity/src/QPaginatedEntity.ts:10
Base class for paginated entity results.
Provides standard pagination fields and metadata for lists of entities.
Extends
Type Parameters
TEntity
TEntity
Constructors
Constructor
new QPaginatedEntity<
TEntity>():QPaginatedEntity<TEntity>
Returns
QPaginatedEntity<TEntity>
Inherited from
Properties
_cachedDefaults?
protectedoptional_cachedDefaults?:Record<string,any>
Defined in: entity/src/QEntity.ts:45
Default values for entity fields based on field definitions.
Inherited from
_definition
protected_definition:QEntityDefinition
Defined in: entity/src/QEntity.ts:95
Definition of entity fields and their metadata.
Inherited from
_entityName
protected_entityName:string
Defined in: entity/src/QEntity.ts:83
Name of the entity type.
Inherited from
_hooks
protected_hooks:QEntityHook
Defined in: entity/src/QEntity.ts:133
Collection of registered lifecycle hooks for this entity.
Inherited from
_initialFill
protected_initialFill:boolean=false
Defined in: entity/src/QEntity.ts:33
Flag indicating if entity is being initially filled.
Inherited from
_isFillMethodActive
protected_isFillMethodActive:boolean=false
Defined in: entity/src/QEntity.ts:121
Flag indicating if the fill method is currently executing.
Inherited from
_modifiedFields
protected_modifiedFields:string[]
Defined in: entity/src/QEntity.ts:41
List of field names that have been modified since creation.
Inherited from
_rowState
protected_rowState:QRowState
Defined in: entity/src/QEntity.ts:50
Current state of the entity row (created, modified, deleted, etc).
Inherited from
_runHooks
protected_runHooks:boolean=true
Defined in: entity/src/QEntity.ts:37
Flag controlling whether lifecycle hooks should be executed.
Inherited from
_sealed
protected_sealed:boolean=false
Defined in: entity/src/QEntity.ts:71
Flag to mark an object as sealed.
Inherited from
count
count:
number
Defined in: entity/src/QPaginatedEntity.ts:27
Total number of items across all pages
data
data:
TEntity[]
Defined in: entity/src/QPaginatedEntity.ts:32
Collection of entity data for the current page
hasNext
hasNext:
boolean
Defined in: entity/src/QPaginatedEntity.ts:38
Whether there are more pages after the current one
hasPrevious
hasPrevious:
boolean
Defined in: entity/src/QPaginatedEntity.ts:51
Whether there are previous pages before the current one
nextPage?
optionalnextPage?:string
Defined in: entity/src/QPaginatedEntity.ts:45
URL or token for the next page, if available
page
page:
number
Defined in: entity/src/QPaginatedEntity.ts:15
Current page number
previousPage?
optionalpreviousPage?:string
Defined in: entity/src/QPaginatedEntity.ts:58
URL or token for the previous page, if available
size
size:
number
Defined in: entity/src/QPaginatedEntity.ts:21
Number of items per page
Entity
readonlystaticEntity:"QEntity"="QEntity"
Defined in: entity/src/QEntity.ts:28
Entity name identifier, used for metadata lookup.
Inherited from
Accessors
canRunHooks
Get Signature
get
protectedcanRunHooks():boolean
Defined in: entity/src/QEntity.ts:145
Gets whether lifecycle hooks can be executed.
Returns
boolean
Inherited from
defaultValues
Get Signature
get
protecteddefaultValues():Record<string,any>
Defined in: entity/src/QEntity.ts:163
Returns
Record<string, any>
Inherited from
definition
Get Signature
get definition():
QEntityDefinition
Defined in: entity/src/QEntity.ts:100
Gets the entity field definitions.
Returns
Inherited from
entityName
Get Signature
get entityName():
string
Defined in: entity/src/QEntity.ts:88
Gets the entity type name.
Returns
string
Inherited from
fields
Get Signature
get fields():
string[]
Defined in: entity/src/QEntity.ts:107
Gets the list of field names defined on this entity.
Returns
string[]
Inherited from
hooks
Get Signature
get
protectedhooks():QEntityHook
Defined in: entity/src/QEntity.ts:138
Gets the registered lifecycle hooks.
Returns
Inherited from
isFillMethodActive
Get Signature
get
protectedisFillMethodActive():boolean
Defined in: entity/src/QEntity.ts:126
Gets whether the fill method is currently active.
Returns
boolean
Inherited from
isInitialFill
Get Signature
get
protectedisInitialFill():boolean
Defined in: entity/src/QEntity.ts:152
Gets whether entity is being initially filled.
Returns
boolean
Inherited from
isSealed
Get Signature
get isSealed():
boolean
Defined in: entity/src/QEntity.ts:76
Read-only flag to check if the object is sealed.
Returns
boolean
Inherited from
logger
Get Signature
get
protectedlogger():IQLogger
Defined in: entity/src/QEntity.ts:159
The logger instance for this entity.
Returns
IQLogger
Inherited from
rowState
Get Signature
get rowState():
QRowState
Defined in: entity/src/QEntity.ts:55
Gets the current row state of the entity.
Returns
Set Signature
set rowState(
rowState):void
Defined in: entity/src/QEntity.ts:64
Sets the current row state of the entity.
Parameters
rowState
New row state
Returns
void
Inherited from
selectableFields
Get Signature
get selectableFields():
string[]
Defined in: entity/src/QEntity.ts:114
Gets all fields marked as selectable in queries.
Returns
string[]
Inherited from
Methods
clone()
clone(
properties?):QPaginatedEntity<TEntity>
Defined in: entity/src/QEntity.ts:283
Creates a clone of the current entity.
Parameters
properties?
QEntityOptions<QPaginatedEntity<TEntity>>
A list of properties that you want to pass to the new instance
Returns
QPaginatedEntity<TEntity>
Inherited from
compare()
compare(
other):boolean
Defined in: entity/src/QEntity.ts:362
Compares this entity with another entity for deep equality.
Parameters
other
The other entity to compare with
Returns
boolean
True if entities are equal, false otherwise
Inherited from
disableHooks()
protecteddisableHooks():void
Defined in: entity/src/QEntity.ts:455
Disables execution of lifecycle hooks.
Returns
void
Inherited from
enableHooks()
protectedenableHooks():void
Defined in: entity/src/QEntity.ts:462
Enables execution of lifecycle hooks.
Returns
void
Inherited from
fill()
fill(
options?,initial?,fillOptions?):QPaginatedEntity<TEntity>
Defined in: entity/src/QEntity.ts:184
Method used to init the entity with data.
Parameters
options?
QEntityOptions<QPaginatedEntity<TEntity>>
A map of properties with values that can be filled in the current entity
initial?
boolean = false
Initial row fill
fillOptions?
Returns
QPaginatedEntity<TEntity>
Inherited from
freeze()
freeze():
void
Defined in: entity/src/QEntity.ts:301
Freezes the current entity to the current values and properties list. Prevents any further modifications to the entity.
Returns
void
Inherited from
getFlaggedField()
getFlaggedField(
flag):string[]
Defined in: entity/src/QEntity.ts:407
Gets all fields that have a specific flag.
Parameters
flag
string
Flag to check for
Returns
string[]
Array of field names with the flag
Inherited from
getHooks()
protectedgetHooks(name):MethodDecoratorType<QEntity,any[],unknown>[]
Defined in: entity/src/QEntity.ts:448
Gets all registered hooks of a specific type.
Parameters
name
Type of hooks to retrieve
Returns
MethodDecoratorType<QEntity, any[], unknown>[]
Inherited from
isDeleted()
isDeleted():
boolean
Defined in: entity/src/QEntity.ts:274
Checks if the entity is marked as deleted.
Returns
boolean
Inherited from
isFieldModified()
protectedisFieldModified(field):boolean
Defined in: entity/src/QEntity.ts:422
Checks if a field has been modified since entity creation.
Parameters
field
string
Field name to check
Returns
boolean
Inherited from
isModified()
isModified():
boolean
Defined in: entity/src/QEntity.ts:253
Checks if the entity has been modified (created or updated).
Returns
boolean
Inherited from
isNew()
isNew():
boolean
Defined in: entity/src/QEntity.ts:260
Checks if the entity is newly created.
Returns
boolean
Inherited from
isUnmodified()
isUnmodified():
boolean
Defined in: entity/src/QEntity.ts:246
Checks if the entity is in an unmodified state.
Returns
boolean
Inherited from
isUpdated()
isUpdated():
boolean
Defined in: entity/src/QEntity.ts:267
Checks if the entity has been updated after creation.
Returns
boolean
Inherited from
markDeleted()
markDeleted():
void
Defined in: entity/src/QEntity.ts:232
Marks the entity as deleted.
Returns
void
Inherited from
markModified()
markModified():
void
Defined in: entity/src/QEntity.ts:239
Marks the entity as modified.
Returns
void
Inherited from
runHooks()
protectedrunHooks(name):void
Defined in: entity/src/QEntity.ts:431
Executes all registered hooks of a specific type.
Parameters
name
Type of hooks to run
Returns
void
Inherited from
setInitialFill()
protectedsetInitialFill():void
Defined in: entity/src/QEntity.ts:469
Marks the entity as being initially filled.
Returns
void
Inherited from
toJSON()
toJSON():
ObjectLiteral
Defined in: entity/src/QEntity.ts:312
Returns the data from the entity as a serializable object.
This method transforms the entity to a plain object suitable for JSON serialization, hiding internal properties and fields marked as hidden.
Returns
ObjectLiteral
Inherited from
toObject()
toObject<
T>():T
Defined in: entity/src/QEntity.ts:345
Return the data from the entity as an object.
Use this method when you want to extract the data from the entity.
This is an alias for the toJSON method.
Type Parameters
T
T = ObjectLiteral
Returns
T
Inherited from
toString()
toString():
string
Defined in: entity/src/QEntity.ts:352
Returns a string representation of the entity.
Returns
string
Inherited from
unsetInitialFill()
protectedunsetInitialFill():void
Defined in: entity/src/QEntity.ts:476
Marks the entity as no longer being initially filled.
Returns
void
Inherited from
validate()
validate(
returnable?):Promise<QEntityValidationResults>
Defined in: entity/src/QEntity.ts:371
Validate the entity fields.
Parameters
returnable?
boolean
When true, return validation errors instead of throwing
Returns
Promise<QEntityValidationResults>