getCachedEntityByMapID<O> method

  1. @override
O? getCachedEntityByMapID<O>(
  1. Map<Object?, Object?> map, {
  2. Type? type,
  3. dynamic instantiate = true,
})
override

Returns a cached entity of type with an id from map entries. See getEntityIDFromMap.

Implementation

@override
O? getCachedEntityByMapID<O>(
  Map<Object?, Object?> map, {
  Type? type,
  instantiate = true,
}) {
  var id = getEntityIDFromMap(map, type: type);
  if (id == null) return null;

  var cachedEntity = getCachedEntityByID(
    id,
    type: type,
    instantiate: instantiate,
  );

  return cachedEntity != null ? cachedEntity as O : null;
}