DB getter

This commit is contained in:
Philipp Holzer 2019-02-28 13:58:01 +01:00
parent bfc4615440
commit 7af787728f
No known key found for this signature in database
GPG key ID: 517BE60E2CE5C8A5

View file

@ -129,6 +129,11 @@ class App
*/ */
private $profiler; private $profiler;
/**
* @var IDatabase The database of this app
*/
private $database;
/** /**
* Returns the current config cache of this node * Returns the current config cache of this node
* *
@ -184,6 +189,16 @@ class App
return $this->router; return $this->router;
} }
/**
* The database of this app
*
* @return IDatabase
*/
public function getDb()
{
return $this->database;
}
/** /**
* Register a stylesheet file path to be included in the <head> tag of every page. * Register a stylesheet file path to be included in the <head> tag of every page.
* Inclusion is done in App->initHead(). * Inclusion is done in App->initHead().
@ -241,6 +256,7 @@ class App
BaseObject::setApp($this); BaseObject::setApp($this);
$this->config = $config; $this->config = $config;
$this->database = $database;
$this->mode = $mode; $this->mode = $mode;
$this->router = $router; $this->router = $router;
$this->profiler = $profiler; $this->profiler = $profiler;