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
**ModelTrait** supports nested relation calls, but these can be resource intensive so may
139
138
be disabled by changing `$allowNesting` in the config. With nesting enabled, any related
140
139
items will also load their related items (but not infinitely):
141
-
```
140
+
```php
142
141
/* Define your models */
143
142
class UserModel
144
143
{
@@ -162,6 +161,14 @@ foreach ($groups as $group)
162
161
}
163
162
```
164
163
164
+
### Soft Deletes
165
+
166
+
If your target relations correspond to a CodeIgniter Model that uses [soft deletion](https://codeigniter.com/user_guide/models/model.html#usesoftdeletes)
167
+
then you may include the table name in the `array $withDeletedRelations` property to include
168
+
soft deleted items. This is particularly helpful for tight relationships, like when an item
169
+
`belongsTo` another item that has been soft deleted. `$withDeletedRelations` works on both
170
+
Entities and Models.
171
+
165
172
## Performance
166
173
167
174
*WARNING*: Be aware that **Relations** relies on a schema generated from the **Schemas**
@@ -170,7 +177,7 @@ request initiates the load. The schema will attempt to cache to prevent this del
170
177
if your cache is not configured correctly you will likely experience noticeable performance
171
178
degradation. The recommended approach is to have a cron job generate your schema regularly
172
179
so it never expires and no user will trigger the un-cached load, e.g.:
0 commit comments