public function getZendInstance($class, $options)
{
if (strpos($class, 'Zend\\Filter') === false) {
$class = "Zend\\Filter\\" . $class;
}
if (!class_exists($class)) {
throw new InvalidZendFilterException("Could not find or autoload: {$class}");
}
try {
new \ReflectionMethod($class, 'setOptions');
$filter = new $class();
$filter->setOptions($options);
return $filter;
} catch (\ReflectionException $e) {
return new $class($options);
}
}