public function remember(RecordInterface $entity, bool $ignoreLimit = false): RecordInterface
    {
        if (!$ignoreLimit && !is_null($this->maxSize) && count($this->entities) > $this->maxSize - 1) {
            throw new MapException('Entity cache size exceeded');
        }

        if (empty($entity->primaryKey())) {
            throw new MapException("Unable to store non identified entity " . get_class($entity));
        }

        $cacheID = get_class($entity) . ':' . $entity->primaryKey();

        return $this->entities[$cacheID] = $entity;
    }