setOptions($opts); } /** * Set serializer options * * @param array|Zend_Config $opts Serializer options * @return Zend_Serializer_Adapter_AdapterAbstract */ public function setOptions($opts) { if ($opts instanceof Zend_Config) { $opts = $opts->toArray(); } else { $opts = (array) $opts; } foreach ($opts as $k => $v) { $this->setOption($k, $v); } return $this; } /** * Set a serializer option * * @param string $name Option name * @param mixed $value Option value * @return Zend_Serializer_Adapter_AdapterAbstract */ public function setOption($name, $value) { $this->_options[(string) $name] = $value; return $this; } /** * Get serializer options * * @return array */ public function getOptions() { return $this->_options; } /** * Get a serializer option * * @param string $name * @return mixed * @throws Zend_Serializer_Exception */ public function getOption($name) { $name = (string) $name; if (!array_key_exists($name, $this->_options)) { #require_once 'Zend/Serializer/Exception.php'; throw new Zend_Serializer_Exception('Unknown option name "'.$name.'"'); } return $this->_options[$name]; } }