InteractsWithDatabase<T> mixin
- Mixin applications
Properties
- exists ↔ bool
-
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
- id ↔ int?
-
getter/setter pair
- primaryKey → String
-
no setter
-
query
→ QueryBuilderInterface<
T> -
Get a new query builder for the model's table.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- table → String
-
no setter
- tableName → String
-
no setter
Methods
-
all(
) → Future< List< T> > - Get all models.
-
decrement(
String column, [int amount = 1]) → Future< void> - Decrement a column's value.
-
delete(
) → Future< bool> - Delete the model from the database.
-
find(
dynamic id) → Future< T?> - Find a model by its primary key.
-
findOrFail(
dynamic id) → Future< T> - Find a model by its primary key or throw an exception.
-
fresh(
[List< String> withRelations = const []]) → Future<T?> - Get a fresh instance of the model from the database.
-
getKey(
) → dynamic -
increment(
String column, [int amount = 1]) → Future< void> - Increment a column's value.
-
newFactory(
Map< String, dynamic> data) → T -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
refresh(
) → Future< void> - Refresh the model from the database.
-
save(
) → Future< bool> - Save the model to the database.
-
toString(
) → String -
A string representation of this object.
inherited
-
update(
Map< String, dynamic> attributes) → Future<bool> - Update the model in the database.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited