public function __construct(Connection $connection, $storageName, array $entityPrimaryKey, Cache $cache)
{
$this->platform = new CachedPlatform($connection, $cache->derive('db_reflection'));
$this->storageName = $storageName;
$this->entityPrimaryKey = $entityPrimaryKey;
$cache = $cache->derive('storage_reflection');
$this->mappings = $cache->load('nextras.orm.storage_reflection.' . md5($this->storageName) . '.mappings', function () {
return $this->getDefaultMappings();
});
$this->modifiers = $cache->load('nextras.orm.storage_reflection.' . md5($this->storageName) . '.modifiers', function () {
return $this->getDefaultModifiers();
});
}