The Gitlab instance will be restarted on Monday April 28th at 2AM. There will be a short interruption of service.

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

Code simplification.

parent 28046ad1
No related merge requests found
......@@ -40,7 +40,9 @@ use Zend\Session\SaveHandler\SaveHandlerInterface;
abstract class AbstractBase implements SaveHandlerInterface,
\VuFind\Db\Table\DbTableAwareInterface
{
use \VuFind\Db\Table\DbTableAwareTrait;
use \VuFind\Db\Table\DbTableAwareTrait {
getDbTable as getTable;
}
/**
* Session lifetime in seconds
......@@ -139,16 +141,4 @@ abstract class AbstractBase implements SaveHandlerInterface,
// is called by the garbage collector and everything is good.
// Something to keep in mind though.
}
/**
* Get a database table object.
*
* @param string $table Name of table to retrieve
*
* @return \VuFind\Db\Table\Gateway
*/
protected function getTable($table)
{
return $this->getDbTableManager()->get($table);
}
}
\ No newline at end of file
......@@ -57,7 +57,7 @@ class Db extends AbstractBase implements \VuFind\Db\Table\DbTableAwareInterface
// Make sure the browser version is a legal length.
$userData['browserVersion'] = substr($userData['browserVersion'], 0, 8);
$this->getTable('UserStatsFields')->save($data, $userData);
$this->getDbTable('UserStatsFields')->save($data, $userData);
}
/**
......@@ -71,7 +71,7 @@ class Db extends AbstractBase implements \VuFind\Db\Table\DbTableAwareInterface
public function getFullList($field, $value = array())
{
// Use the model
return $this->getTable('UserStatsFields')->getFields($field, $value)
return $this->getDbTable('UserStatsFields')->getFields($field, $value)
->toArray();
}
......@@ -85,19 +85,7 @@ class Db extends AbstractBase implements \VuFind\Db\Table\DbTableAwareInterface
*/
public function getBrowserStats($version, $limit)
{
$userStats = $this->getTable('UserStats');
$userStats = $this->getDbTable('UserStats');
return $userStats->getBrowserStats($version, $limit);
}
/**
* Get a database table object.
*
* @param string $table Name of table to retrieve
*
* @return \VuFind\Db\Table\Gateway
*/
protected function getTable($table)
{
return $this->getDbTableManager()->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