MCPcopy Create free account
hub / github.com/mikro-orm/mikro-orm / getItems

Method getItems

packages/core/src/entity/Collection.ts:218–224  ·  view source on GitHub ↗

* Returns the items (the collection must be initialized)

(check = true)

Source from the content-addressed store, hash-verified

216 * Returns the items (the collection must be initialized)
217 */
218 getItems(check = true): T[] {
219 if (check) {
220 this.checkInitialized();
221 }
222
223 return [...this.#items];
224 }
225
226 /** Serializes the collection items to plain JSON objects. Returns an empty array if not initialized. */
227 toJSON<TT extends T>(): EntityDTO<TT>[] {

Callers 3

loadItemsMethod · 0.95
getIdentifiersMethod · 0.95
[Symbol.iterator]Method · 0.95

Calls 1

checkInitializedMethod · 0.95

Tested by

no test coverage detected