readById method

  1. @override
Future<T?> readById(
  1. dynamic id, {
  2. bool locked = false,
  3. bool skipLocked = false,
})
override

Find and read an element by its DataBean.idField value.

Returns the element or null if no element with the given id exists.

Must throw a MissingIdFieldError when the DataObject does not provide an ID-field.

Implementation

@override
Future<T?> readById(
  dynamic id, {
  bool locked = false,
  bool skipLocked = false,
}) async {
  final revision = await revisableReadById(
    id,
    locked: locked,
    skipLocked: skipLocked,
  );
  return revision?.data;
}