Traits§
- Model
Hooks - Optional lifecycle hooks for a Model.
All methods have a no-op default — implement only what you need.
Returning
Errfrom abefore_*hook cancels the operation (no SQL runs); the error reaches the caller asError::Hook. Anafter_*error is returned too, but the statement has already run: it is rolled back only if the caller is insideatomic()/ a transaction.