MonitoringBackend: just a few comments

fixes #7635
This commit is contained in:
Thomas Gelf 2014-11-11 17:33:31 +01:00
parent 78fd5109ac
commit 1ca83c001f
1 changed files with 17 additions and 1 deletions

View File

@ -14,8 +14,10 @@ use Icinga\Exception\ProgrammingError;
class MonitoringBackend implements Selectable, Queryable, ConnectionInterface class MonitoringBackend implements Selectable, Queryable, ConnectionInterface
{ {
/** /**
* @var Config * Backend configuration
* *
* @var Config
*/
protected $config; protected $config;
/** /**
@ -58,6 +60,15 @@ class MonitoringBackend implements Selectable, Queryable, ConnectionInterface
$this->config = $config; $this->config = $config;
} }
/**
* Get a backend instance
*
* You may ask for a specific backend name or get the default one otherwise
*
* @param string $name Backend name
*
* @return MonitoringBackend
*/
public static function instance($name = null) public static function instance($name = null)
{ {
if (! array_key_exists($name, self::$instances)) { if (! array_key_exists($name, self::$instances)) {
@ -206,6 +217,11 @@ class MonitoringBackend implements Selectable, Queryable, ConnectionInterface
return self::instance($name); return self::instance($name);
} }
/**
* Get this backend's internal resource
*
* @return mixed
*/
public function getResource() public function getResource()
{ {
if ($this->resource === null) { if ($this->resource === null) {