public function __construct(array $options)
{
if (!isset($options['db'])) {
throw new Exception("Parameter 'db' is required");
}
if (!isset($options['table'])) {
throw new Exception("Parameter 'table' is required");
}
if (!isset($options['language'])) {
throw new Exception("Parameter 'language' is required");
}
if (isset($options['useIcuMessageFormatter'])) {
if (!class_exists('\\MessageFormatter')) {
throw new Exception('"MessageFormatter" class is required');
}
$this->useIcuMessageFormatter = (bool) $options['useIcuMessageFormatter'];
}
$this->stmtSelect = sprintf('SELECT value FROM %s WHERE language = :language AND key_name = :key_name', $options['table']);
$this->stmtExists = sprintf('SELECT COUNT(*) AS `count` FROM %s WHERE language = :language AND key_name = :key_name', $options['table']);
$this->options = $options;
}