Skip to main content
Version: 4.4

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@41631?: unknown ; __@PrimaryKeyType@41543?: unknown ; __helper?: undefined | IWrappedEntityInternal<O, keyof O, keyof O> ; __meta?: undefined | EntityMetadata<O> ; __platform?: undefined | Platform }, items?: T[]): ArrayCollection<T, O>

Type parameters:#

Name
T
O

Parameters:#

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

Returns: ArrayCollection<T, O>

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

Properties#

_count#

Protected Optional _count: undefined | number

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


_property#

Private Optional _property: undefined | 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@41631?: unknown ; __@PrimaryKeyType@41543?: unknown ; __helper?: undefined | IWrappedEntityInternal<O, keyof O, keyof O> ; __meta?: undefined | EntityMetadata<O> ; __platform?: undefined | Platform }

Accessors#

length#

length(): number

Returns: number

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


property#

property(): EntityProperty<T>

internal

Returns: EntityProperty<T>

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

Methods#

[Symbol.iterator]#

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

Returns: IterableIterator<T>

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


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:117


count#

count(): number

Returns: number

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


getIdentifiers#

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

Type parameters:#

NameTypeDefault
UIPrimaryKeyValuePrimary<T\> & string \

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:197


isInitialized#

isInitialized(fully?: boolean): boolean

Parameters:#

NameTypeDefault value
fullybooleanfalse

Returns: boolean

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


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:157


propagateToInverseSide#

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

Parameters:#

NameType
itemT
methodadd | remove

Returns: void

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


propagateToOwningSide#

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

Parameters:#

NameType
itemT
methodadd | remove

Returns: void

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


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:113


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:184


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 renovate[bot]