_options = $options; } /** * Factory method to return a preconfigured Zend_Service_StrikeIron_* * instance. * * @param null|string $options Service options * @return object Zend_Service_StrikeIron_* instance */ public function getService($options = array()) { $class = isset($options['class']) ? $options['class'] : 'Base'; unset($options['class']); if (strpos($class, '_') === false) { $class = "Zend_Service_StrikeIron_{$class}"; } try { Zend_Loader::loadClass($class); } catch (Exception $e) { $msg = "Service '$class' could not be loaded: " . $e->getMessage(); throw new Zend_Service_StrikeIron_Exception($msg, $e->getCode()); } // instantiate and return the service $service = new $class(array_merge($this->_options, $options)); return $service; } }