/** * @param mixed $metadataCache Either a Cache object, or a string naming a Registry key * @return \libDb\Registry * @throws Exception */ protected static function _setupMetadataCache($metadataCache) { if ($metadataCache === null) { return null; } if (is_string($metadataCache)) { $metadataCache = \libDb\Registry::get($metadataCache); } if (!$metadataCache instanceof \libDb\Registry) { throw new Exception('Argument must be of type Registry '); } return $metadataCache; }