/** * @param array $parameters * @throws Exception\InvalidArgumentException * @return Platform\PlatformInterface */ protected function createPlatform($parameters) { if (isset($parameters['platform'])) { $platformName = $parameters['platform']; } elseif ($this->driver instanceof Driver\DriverInterface) { $platformName = $this->driver->getDatabasePlatformName(Driver\DriverInterface::NAME_FORMAT_CAMELCASE); } else { throw new Exception\InvalidArgumentException('A platform could not be determined from the provided configuration'); } $options = isset($parameters['platform_options']) ? $parameters['platform_options'] : array(); switch ($platformName) { case 'Mysql': return new Platform\Mysql($options); default: return new Platform\Sql92($options); } }