mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-03-31 16:45:27 +00:00
change database access, use local cache getter implementation
This commit is contained in:
parent
caba131a00
commit
6b21d69104
3 changed files with 4 additions and 17 deletions
|
|
@ -9,7 +9,7 @@ use \Yggverse\Yoda\Model\Pool;
|
|||
|
||||
abstract class Connection implements \Yggverse\Yoda\Interface\Model\Connection
|
||||
{
|
||||
private Database $_database;
|
||||
public Database $database;
|
||||
|
||||
private Pool $_pool;
|
||||
|
||||
|
|
@ -17,8 +17,8 @@ abstract class Connection implements \Yggverse\Yoda\Interface\Model\Connection
|
|||
Database $database,
|
||||
?Pool $pool = null
|
||||
) {
|
||||
// Init database connection to store cached results
|
||||
$this->_database = $database;
|
||||
// Init database connection
|
||||
$this->database = $database;
|
||||
|
||||
// Use shared memory pool for async operations
|
||||
$this->_pool = $pool ? $pool : new Pool;
|
||||
|
|
@ -261,15 +261,6 @@ abstract class Connection implements \Yggverse\Yoda\Interface\Model\Connection
|
|||
return null;
|
||||
}
|
||||
|
||||
public function getCache(
|
||||
string $request
|
||||
): ?object
|
||||
{
|
||||
return $this->_database->cache->get(
|
||||
$request
|
||||
);
|
||||
}
|
||||
|
||||
public function reset(): void
|
||||
{
|
||||
$this->_pool->reset();
|
||||
|
|
|
|||
|
|
@ -82,10 +82,6 @@ interface Connection
|
|||
|
||||
public function getLength(): ?int;
|
||||
|
||||
public function getCache(
|
||||
string $request
|
||||
): ?object;
|
||||
|
||||
public function reset(): void;
|
||||
|
||||
public function close(): void;
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@ class Nex
|
|||
}
|
||||
|
||||
// Try cache
|
||||
else if ($cache = $this->_connection->getCache($address->get()))
|
||||
else if ($cache = $this->_connection->database->cache->get($address->get()))
|
||||
{
|
||||
$this->_connection->setTitle(
|
||||
$cache->title
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue