protected function setFilterOptions(FilterOptionInterface $filter, array $options, array $validOptions)
    {
        foreach ($options as $option => $value) {
            if (!array_key_exists('setter', $validOptions[$option])) {
                throw new FilterOptionException(sprintf(
                    'Key "setter" is not present in option "%s" restrictions array (filter "%s").',
                    $option, get_class($filter)
                ));
            }

            $optionSetter = $validOptions[$option]['setter'];

            if (!method_exists($filter, $optionSetter)) {
                throw new FilterOptionException(sprintf(
                    'There is no such method "%s" in filter "%s".', $optionSetter, get_class($filter)
                ));
            }

            $filter->$optionSetter($value);
        }

        return $this;
    }