public function setFilter($attribute, array $values, $exclude = false)
{
if (!is_string($attribute)) {
throw new \InvalidArgumentException('Attribute name must be a string.');
}
if (!count($values)) {
throw new \InvalidArgumentException('Values array must not be empty.');
}
foreach ($values as $value) {
if (!is_numeric($value)) {
throw new \InvalidArgumentException('Value must be numeric.');
}
}
$exclude = (bool) $exclude;
$this->filters[] = array('type' => self::SPH_FILTER_VALUES, 'attr' => $attribute, 'exclude' => $exclude, 'values' => $values);
return $this;
}