Skip to content
Snippets Groups Projects
Commit b2843d0c authored by Demian Katz's avatar Demian Katz
Browse files

Switched to more appropriate marker interface.

parent 751b6c4c
No related merge requests found
...@@ -26,8 +26,6 @@ ...@@ -26,8 +26,6 @@
* @link http://vufind.org Main Site * @link http://vufind.org Main Site
*/ */
namespace VuFind\Statistics\Driver; namespace VuFind\Statistics\Driver;
use Zend\ServiceManager\ServiceLocatorAwareInterface,
Zend\ServiceManager\ServiceLocatorInterface;
/** /**
* Writer to put statistics into the DB * Writer to put statistics into the DB
...@@ -38,14 +36,14 @@ use Zend\ServiceManager\ServiceLocatorAwareInterface, ...@@ -38,14 +36,14 @@ use Zend\ServiceManager\ServiceLocatorAwareInterface,
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License
* @link http://vufind.org Main Site * @link http://vufind.org Main Site
*/ */
class Db extends AbstractBase implements ServiceLocatorAwareInterface class Db extends AbstractBase implements \VuFind\Db\Table\DbTableAwareInterface
{ {
/** /**
* Service locator * Database table plugin manager
* *
* @var ServiceLocatorInterface * @var \VuFind\Db\Table\PluginManager
*/ */
protected $serviceLocator; protected $tableManager;
/** /**
* Write a message to the log. * Write a message to the log.
...@@ -104,26 +102,29 @@ class Db extends AbstractBase implements ServiceLocatorAwareInterface ...@@ -104,26 +102,29 @@ class Db extends AbstractBase implements ServiceLocatorAwareInterface
} }
/** /**
* Set the service locator. * Get the table plugin manager. Throw an exception if it is missing.
* *
* @param ServiceLocatorInterface $serviceLocator Locator to register * @throws \Exception
* * @return \VuFind\Db\Table\PluginManager
* @return AbstractBase
*/ */
public function setServiceLocator(ServiceLocatorInterface $serviceLocator) public function getDbTableManager()
{ {
$this->serviceLocator = $serviceLocator; if (null === $this->tableManager) {
return $this; throw new \Exception('DB table manager missing.');
}
return $this->tableManager;
} }
/** /**
* Get the service locator. * Set the table plugin manager.
*
* @param \VuFind\Db\Table\PluginManager $manager Plugin manager
* *
* @return \Zend\ServiceManager\ServiceLocatorInterface * @return void
*/ */
public function getServiceLocator() public function setDbTableManager(\VuFind\Db\Table\PluginManager $manager)
{ {
return $this->serviceLocator; $this->tableManager = $manager;
} }
/** /**
...@@ -135,7 +136,6 @@ class Db extends AbstractBase implements ServiceLocatorAwareInterface ...@@ -135,7 +136,6 @@ class Db extends AbstractBase implements ServiceLocatorAwareInterface
*/ */
protected function getTable($table) protected function getTable($table)
{ {
return $this->getServiceLocator()->getServiceLocator() return $this->tableManager->get($table);
->get('DbTablePluginManager')->get($table);
} }
} }
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