You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/php/database-objects.md
+95Lines changed: 95 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -169,6 +169,101 @@ Of course, you do not have to set the property after creating the list object, y
169
169
) }}
170
170
171
171
172
+
## DatabaseObjectCollection
173
+
174
+
A Database Object Collection is a container for a group of `DatabaseObject` instances that optimizes how additional runtime data is loaded and shared between objects.
175
+
176
+
### Motivation
177
+
178
+
Some database objects require extra runtime data, for example, a `UserProfile` or file attachments.
179
+
Loading this data on demand per object is inefficient, as it requires repeated queries for each object.
180
+
181
+
Earlier approaches like the `Viewable*` classes tried to address this by preloading extra data:
182
+
183
+
- ✅ Efficient in some cases, especially when JOINs are used.
184
+
- ❌ Can be wasteful if not all of the extra data is needed.
185
+
- ❌ JOIN-based solutions lack reliable type hints, sometimes resulting in missing or inconsistent data.
0 commit comments