public function __construct(Connection $connection, Cache $cache) { $key = md5(json_encode($connection->getConfig())); $this->connection = $connection; $this->cache = $cache->derive('mapper.' . $key); }