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
You may need to add custom logic to your API which can do with using the following extension hooks available in the table below. Implement a hook by adding one of these methods directly to your subclass of `RestApiEndpoint` using the `protected` visibility. You can also implement them on extension classes with a `public` visibility.
@@ -422,6 +424,8 @@ Notes:
422
424
423
425
| Extension hook | Description |
424
426
| - | - |
427
+
|`onBeforeApi()`| Called during all requests before any processing |
428
+
|`onAfterApi()`| Called during all requests after any processing |
425
429
|`onViewOne(DataObject $obj)`| Called during `GET` requests to view a single record before rendering JSON for response |
426
430
|`onViewMany(array $objs)`| Called during `GET` requests to view many records before rendering JSON for response |
427
431
|`onCreateBeforeWrite(DataObject $obj)`| Called during `POST` requests before calling `$obj->write()`|
0 commit comments