From 98fbedf2394c12dbd3a1c08c71d4e8d5510f95dc Mon Sep 17 00:00:00 2001
From: Tom Misilo <misilot@fit.edu>
Date: Tue, 12 Apr 2016 14:55:12 -0400
Subject: [PATCH] Add Support for Driver to Config and Factory

---
 module/VuFind/config/module.config.php          |  2 ++
 module/VuFind/src/VuFind/ILS/Driver/Factory.php | 12 ++++++++++++
 2 files changed, 14 insertions(+)

diff --git a/module/VuFind/config/module.config.php b/module/VuFind/config/module.config.php
index 0c4d4ae08e3..aeb81e4541b 100644
--- a/module/VuFind/config/module.config.php
+++ b/module/VuFind/config/module.config.php
@@ -387,6 +387,7 @@ $config = [
                     'horizonxmlapi' => 'VuFind\ILS\Driver\Factory::getHorizonXMLAPI',
                     'multibackend' => 'VuFind\ILS\Driver\Factory::getMultiBackend',
                     'noils' => 'VuFind\ILS\Driver\Factory::getNoILS',
+                    'koharest' => 'VuFind\ILS\Driver\Factory::getKohaRest',
                     'unicorn' => 'VuFind\ILS\Driver\Factory::getUnicorn',
                     'voyager' => 'VuFind\ILS\Driver\Factory::getVoyager',
                     'voyagerrestful' => 'VuFind\ILS\Driver\Factory::getVoyagerRestful',
@@ -397,6 +398,7 @@ $config = [
                     'evergreen' => 'VuFind\ILS\Driver\Evergreen',
                     'innovative' => 'VuFind\ILS\Driver\Innovative',
                     'koha' => 'VuFind\ILS\Driver\Koha',
+                    'koharest' => 'VuFind\ILS\Driver\KohaRest',
                     'lbs4' => 'VuFind\ILS\Driver\LBS4',
                     'newgenlib' => 'VuFind\ILS\Driver\NewGenLib',
                     'polaris' => 'VuFind\ILS\Driver\Polaris',
diff --git a/module/VuFind/src/VuFind/ILS/Driver/Factory.php b/module/VuFind/src/VuFind/ILS/Driver/Factory.php
index dbff5f4b0b7..8e23a35120e 100644
--- a/module/VuFind/src/VuFind/ILS/Driver/Factory.php
+++ b/module/VuFind/src/VuFind/ILS/Driver/Factory.php
@@ -142,6 +142,18 @@ class Factory
         return new NoILS($sm->getServiceLocator()->get('VuFind\RecordLoader'));
     }
 
+    /**
+     * Factory for KohaRest driver.
+     *
+     * @param ServiceManager $sm Service manager.
+     *
+     * @return KohaRest
+     */
+    public static function getKohaRest(ServiceManager $sm)
+    {
+        return new KohaRest($sm->getServiceLocator()->get('VuFind\DateConverter'));
+    }
+
     /**
      * Factory for Unicorn driver.
      *
-- 
GitLab