protected function __construct(DriverInterface $driver, MapperInterface $mapper, SerialiserMap $serialiser_map = null, KeySchemeInterface $key_scheme = null, Configuration $configuration = null, EntityCachingInterface $cache = null)
{
$this->driver = $driver;
$this->mapper = $mapper;
$this->key_scheme = $key_scheme ?: $driver->getPreferredKeyScheme();
$this->config = $configuration ?: new Configuration();
$this->cache = $cache ?: new EphemeralEntityCache();
if ($serialiser_map) {
$this->serialiser_map = $serialiser_map;
} else {
$this->serialiser_map = new SerialiserMap();
$this->serialiser_map->addSerialiser(new JsonSerialiser());
}
$this->instance_id = uniqid();
$this->registerDefaultSubscribers();
}