Version: 4.3

Class: ArrayCollection<T, O>

Type parameters

Name
T
O

Hierarchy

Indexable

▪ [k: number]: T

Constructors

constructor

+ new ArrayCollection(owner: O & AnyEntity<O>, items?: T[]): ArrayCollection

Defined in packages/core/src/entity/ArrayCollection.ts:13

Parameters:

NameType
ownerO & AnyEntity<O>
items?T[]

Returns: ArrayCollection

Properties

_count

Protected Optional _count: number

Defined in packages/core/src/entity/ArrayCollection.ts:12


_property

Private Optional _property: EntityProperty

Defined in packages/core/src/entity/ArrayCollection.ts:13


initialized

Protected initialized: boolean = true

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


items

Protected Readonly items: Set<T> = new Set<T>()

Defined in packages/core/src/entity/ArrayCollection.ts:10


owner

Readonly owner: O & AnyEntity<O>

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

Accessors

length

• get length(): number

Defined in packages/core/src/entity/ArrayCollection.ts:123

Returns: number


property

• get property(): EntityProperty<T>

Defined in packages/core/src/entity/ArrayCollection.ts:136

internal

Returns: EntityProperty<T>

Methods

[Symbol.iterator]

[Symbol.iterator](): IterableIterator<T>

Defined in packages/core/src/entity/ArrayCollection.ts:127

Returns: IterableIterator<T>


add

add(...items: (T | Reference<T>)[]): void

Defined in packages/core/src/entity/ArrayCollection.ts:64

Parameters:

NameType
...items(T | Reference<T>)[]

Returns: void


contains

contains(item: T | Reference<T>, check?: boolean): boolean

Defined in packages/core/src/entity/ArrayCollection.ts:106

Parameters:

NameType
itemT | Reference<T>
check?boolean

Returns: boolean


count

count(): number

Defined in packages/core/src/entity/ArrayCollection.ts:111

Returns: number


getIdentifiers

getIdentifiers<U>(field?: string): U[]

Defined in packages/core/src/entity/ArrayCollection.ts:52

Type parameters:

NameTypeDefault
UIPrimaryKeyPrimary\<T> & IPrimaryKey

Parameters:

NameType
field?string

Returns: U[]


getItems

getItems(): T[]

Defined in packages/core/src/entity/ArrayCollection.ts:33

Returns: T[]


hydrate

hydrate(items: T[]): void

Defined in packages/core/src/entity/ArrayCollection.ts:85

internal

Parameters:

NameType
itemsT[]

Returns: void


incrementCount

ProtectedincrementCount(value: number): void

Defined in packages/core/src/entity/ArrayCollection.ts:185

Parameters:

NameType
valuenumber

Returns: void


isInitialized

isInitialized(fully?: boolean): boolean

Defined in packages/core/src/entity/ArrayCollection.ts:115

Parameters:

NameTypeDefault value
fullybooleanfalse

Returns: boolean


loadCount

loadCount(): Promise<number>

Defined in packages/core/src/entity/ArrayCollection.ts:29

Returns: Promise<number>


propagate

Protectedpropagate(item: T, method: "add" | "remove"): void

Defined in packages/core/src/entity/ArrayCollection.ts:146

Parameters:

NameType
itemT
method"add" | "remove"

Returns: void


propagateToInverseSide

ProtectedpropagateToInverseSide(item: T, method: "add" | "remove"): void

Defined in packages/core/src/entity/ArrayCollection.ts:154

Parameters:

NameType
itemT
method"add" | "remove"

Returns: void


propagateToOwningSide

ProtectedpropagateToOwningSide(item: T, method: "add" | "remove"): void

Defined in packages/core/src/entity/ArrayCollection.ts:162

Parameters:

NameType
itemT
method"add" | "remove"

Returns: void


remove

remove(...items: (T | Reference<T>)[]): void

Defined in packages/core/src/entity/ArrayCollection.ts:91

Parameters:

NameType
...items(T | Reference<T>)[]

Returns: void


removeAll

removeAll(): void

Defined in packages/core/src/entity/ArrayCollection.ts:102

Returns: void


set

set(items: (T | Reference<T>)[]): void

Defined in packages/core/src/entity/ArrayCollection.ts:77

Parameters:

NameType
items(T | Reference<T>)[]

Returns: void


shouldPropagateToCollection

ProtectedshouldPropagateToCollection(collection: ArrayCollection<O, T>, method: "add" | "remove"): boolean

Defined in packages/core/src/entity/ArrayCollection.ts:172

Parameters:

NameType
collectionArrayCollection<O, T>
method"add" | "remove"

Returns: boolean


toArray

toArray(): Dictionary[]

Defined in packages/core/src/entity/ArrayCollection.ts:37

Returns: Dictionary[]


toJSON

toJSON(): Dictionary[]

Defined in packages/core/src/entity/ArrayCollection.ts:48

Returns: Dictionary[]

Last updated on by Martin Adámek