From 06c173486eca5bf22d90edc06cc48dcdfc053de3 Mon Sep 17 00:00:00 2001 From: Yuri Kuznetsov Date: Tue, 9 Jul 2024 07:56:27 +0300 Subject: [PATCH] collection parentModel --- client/src/collection.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/client/src/collection.js b/client/src/collection.js index 1f81cbb56f..0f2fae3a70 100644 --- a/client/src/collection.js +++ b/client/src/collection.js @@ -147,6 +147,13 @@ class Collection { */ lastSyncPromise = null + /** + * A parent model. To be used for own purposes. E.g. to have access to a parent from related models. + * + * @type {import('model').default} + */ + parentModel + /** * @param {Model[]|null} [models] Models. * @param {{ @@ -934,6 +941,7 @@ class Collection { collection.maxSize = this.maxSize; collection.maxMaxSize = this.maxMaxSize; collection.whereFunction = this.whereFunction; + collection.parentModel = this.parentModel; return collection; }