Skip to content
Snippets Groups Projects
Commit 0bd5e5cf authored by Chris Hallberg's avatar Chris Hallberg
Browse files

Merge branch 'vudl' of https://github.com/crhallberg/vufind into vudl

parents b0d9177c d8daf3bf
Branches
Tags
No related merge requests found
......@@ -9,23 +9,10 @@ $config = array(
),
'service_manager' => array(
'factories' => array(
'VuDL\Connection\Manager' => function ($sm) {
return new \VuDL\Connection\Manager(
array('Solr', 'Fedora'), $sm
);
},
'VuDL\Connection\Fedora' => function ($sm) {
return new \VuDL\Connection\Fedora(
$sm->get('VuFind\Config')->get('VuDL')
);
},
'VuDL\Connection\Solr' => function ($sm) {
return new \VuDL\Connection\Solr(
$sm->get('VuFind\Config')->get('VuDL'),
$sm->get('VuFind\Search\BackendManager')->get('Solr')
);
}
)
'VuDL\Connection\Manager' => array('VuDL\Factory', 'getConnectionManager'),
'VuDL\Connection\Fedora' => array('VuDL\Factory', 'getConnectionFedora'),
'VuDL\Connection\Solr' => array('VuDL\Factory', 'getConnectionSolr'),
),
),
'vufind' => array(
'plugin_managers' => array(
......
......@@ -40,15 +40,46 @@ use Zend\ServiceManager\ServiceManager;
class Factory
{
/**
* Construct the Fedora service.
* Construct the Connection Manager service.
*
* @param ServiceManager $sm Service manager.
*
* @return Fedora
*/
public static function getFedora(ServiceManager $sm)
public static function getConnectionManager(ServiceManager $sm)
{
return new \VuDL\Fedora($sm->get('VuFind\Config')->get('VuDL'));
return new \VuDL\Connection\Manager(
array('Solr', 'Fedora'), $sm
);
}
/**
* Construct the Connection Fedora service.
*
* @param ServiceManager $sm Service manager.
*
* @return Fedora
*/
public static function getConnectionFedora(ServiceManager $sm)
{
return new \VuDL\Connection\Fedora(
$sm->get('VuFind\Config')->get('VuDL')
);
}
/**
* Construct the Connection Solr service.
*
* @param ServiceManager $sm Service manager.
*
* @return Fedora
*/
public static function getConnectionSolr(ServiceManager $sm)
{
return new \VuDL\Connection\Solr(
$sm->get('VuFind\Config')->get('VuDL'),
$sm->get('VuFind\Search\BackendManager')->get('Solr')
);
}
/**
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment