/** * @param Database $database * @throws \Exception */ public static function initDatabase(Database $database) { if (Database::is_a($database)) { self::$db = $database; } else { $className = Database::className(); throw new \Exception("{$database} is not a {$className} object."); } }