Skip to main content
Version: 4.5

Class: ArrayCollection<T, O>#

core.ArrayCollection

Type parameters#

Name
T
O

Hierarchy#

Indexable#

▪ [k: number]: T

Constructors#

constructor#

+ new ArrayCollection<T, O>(owner: O & Partial<O> & { [EntityRepositoryType]?: unknown ; [PrimaryKeyType]?: unknown ; __helper?: IWrappedEntityInternal<O, keyof O, keyof O> ; __meta?: EntityMetadata<O> ; __platform?: Platform }, items?: T[]): ArrayCollection<T, O>

Type parameters:#

Name
T
O

Parameters:#

NameType
ownerO & Partial<O> & { [EntityRepositoryType]?: unknown ; [PrimaryKeyType]?: unknown ; __helper?: IWrappedEntityInternal<O, keyof O, keyof O> ; __meta?: EntityMetadata<O> ; __platform?: Platform }
items?T[]

Returns: ArrayCollection<T, O>

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

Properties#

_count#

Protected Optional _count: number

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


_property#

Private Optional _property: EntityProperty<any>

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


initialized#

Protected initialized: boolean= true

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


items#

Protected Readonly items: Set<T>

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


owner#

Readonly owner: O & Partial<O> & { [EntityRepositoryType]?: unknown ; [PrimaryKeyType]?: unknown ; __helper?: IWrappedEntityInternal<O, keyof O, keyof O> ; __meta?: EntityMetadata<O> ; __platform?: Platform }

Accessors#

length#

• get length(): number

Returns: number

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


property#

• get property(): EntityProperty<T>

internal

Returns: EntityProperty<T>

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

Methods#

[Symbol.iterator]#

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

Returns: IterableIterator<T>

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


add#

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

Parameters:#

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

Returns: void

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


contains#

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

Parameters:#

NameType
itemT | Reference<T>
check?boolean

Returns: boolean

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


count#

count(): number

Returns: number

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


getIdentifiers#

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

Type parameters:#

NameTypeDefault
UIPrimaryKeyValuePrimary<T> & IPrimaryKeyValue

Parameters:#

NameType
field?string

Returns: U[]

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


getItems#

getItems(): T[]

Returns: T[]

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


hydrate#

hydrate(items: T[]): void

internal

Parameters:#

NameType
itemsT[]

Returns: void

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


incrementCount#

ProtectedincrementCount(value: number): void

Parameters:#

NameType
valuenumber

Returns: void

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


isInitialized#

isInitialized(fully?: boolean): boolean

Parameters:#

NameTypeDefault value
fullybooleanfalse

Returns: boolean

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


loadCount#

loadCount(): Promise<number>

Returns: Promise<number>

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


propagate#

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

Parameters:#

NameType
itemT
methodadd | remove

Returns: void

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


propagateToInverseSide#

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

Parameters:#

NameType
itemT
methodadd | remove

Returns: void

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


propagateToOwningSide#

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

Parameters:#

NameType
itemT
methodadd | remove

Returns: void

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


remove#

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

Parameters:#

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

Returns: void

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


removeAll#

removeAll(): void

Returns: void

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


set#

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

Parameters:#

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

Returns: void

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


shouldPropagateToCollection#

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

Parameters:#

NameType
collectionArrayCollection<O, T>
methodadd | remove

Returns: boolean

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


toArray#

toArray(): Dictionary<any>[]

Returns: Dictionary<any>[]

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


toJSON#

toJSON(): Dictionary<any>[]

Returns: Dictionary<any>[]

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

Last updated on by Martin Adámek