/** * Create a service for the specified name. * * @param ServiceLocatorInterface $serviceLocator Service locator * @param string $name Name of service * @param string $requestedName Unfiltered name of service * * @return object */ public function createServiceWithName(ServiceLocatorInterface $serviceLocator, $name, $requestedName) { if ($name === 'favorites') { return new \Finna\Search\Favorites\Options($serviceLocator->getServiceLocator()->get('VuFind\\Config')); } return parent::createServiceWithName($serviceLocator, $name, $requestedName); }
/** * Create a service for the specified name. * * @param ServiceLocatorInterface $serviceLocator Service locator * @param string $name Name of service * @param string $requestedName Unfiltered name of service * * @return object */ public function createServiceWithName(ServiceLocatorInterface $serviceLocator, $name, $requestedName) { if ($name === 'favorites') { return new \Finna\Search\Favorites\Options($serviceLocator->getServiceLocator()->get('VuFind\\Config')); } else { if ($name == 'solr' || $name == 'metalib' || $name == 'combined') { $this->defaultNamespace = 'Finna\\Search'; $class = $this->getClassName($name, $requestedName); return new $class($serviceLocator->getServiceLocator()->get('VuFind\\Config')); } } return parent::createServiceWithName($serviceLocator, $name, $requestedName); }