/**
* Validates the given options as index options.
* @param [String => Mixed] $opts
* @return [String => Mixed]
*/
protected function validate($opts)
{
$opts = parent::validate($opts);
// Validates values.
if (!isset($opts['lrs_id'])) {
throw new Exceptions\Exception('`lrs_id` must be set.');
}
if ($opts['offset'] < 0) {
throw new Exceptions\Exception('`offset` must be a positive interger.');
}
if ($opts['limit'] < 1) {
throw new Exceptions\Exception('`limit` must be a positive interger.');
}
if (!in_array($opts['format'], ['exact', 'canonical', 'ids'])) {
throw new Exceptions\Exception('`format` must be "exact", "canonical", or "ids".');
}
return $opts;
}