OnEvent class
Annotation to mark a method as an event handler.
Used by code generation to automatically register event handlers.
class User extends Model<User> {
@OnEvent(ModelCreatingEvent)
static void beforeCreate(ModelCreatingEvent event) {
event.attributes['created_at'] = DateTime.now();
}
@OnEvent(ModelCreatedEvent)
void afterCreate(ModelCreatedEvent event) {
sendWelcomeEmail(this);
}
}
Properties
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited