Skip to content

Commit 3944112

Browse files
docs: add snippet about pagination control with internal callables
1 parent f919afd commit 3944112

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

docs/BUILDING_CUSTOM_MODEL_CLASSES.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1057,6 +1057,13 @@ class MyCustomModel extends Model {
10571057
}
10581058
```
10591059

1060+
!!! Tip
1061+
In some cases, it may be desirable to have your internal callable handle pagination to ensure the large data sets
1062+
are handled more efficiently. You can delegate pagination control to your internal callable by defining the
1063+
`limit`, `offset` and `reverse` parameters in your internal callable. All three parameters must be present.
1064+
When these parameters are defined, is the responsibility of the internal callable to handle pagination and return
1065+
the correct subset of data based on the parameters' values.
1066+
10601067
### Defining CRUD Methods
10611068

10621069
When creating a non-configuration based Model, the default `create()`, `update()`, and `delete()` methods will throw an error. To enable these methods, you must define the `_create()`, `_update()` and `_delete()` yourself. Below is an

0 commit comments

Comments
 (0)